ERROR security.UserGroupInformation: PriviledgedActionException + java.net.ConnectException解决办法

这篇博客详细记录了在运行Hadoop MapReduce程序时遇到的ERROR security.UserGroupInformation和java.net.ConnectException错误,具体表现为客户端无法连接到服务器192.168.11.104:10020。错误原因是Hadoop历史服务器未启动。解决方案是通过执行'mr-jobhistory-daemon.sh start historyserver'命令来启动历史服务器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HADOOP运行mr程序时报错:

15/05/18 19:25:33 INFO mapred.ClientServiceDelegate: Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server
15/05/18 19:25:34 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:35 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:36 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:37 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:38 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 4 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:39 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:40 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:41 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 7 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:42 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:43 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.104:10020. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
15/05/18 19:25:43 I

### HBase Log4j 警告和 NoSuchMethodError 解决方案 在 Eclipse 中运行 HBase 程序时,可能会遇到 `Log4j` 的警告以及 `NoSuchMethodError` 错误。以下是针对这些问题的具体分析与解决方案。 #### 1. **关于 Log4j 警告** 当出现类似于以下日志消息时: ``` log4j:WARN No appenders could be found for logger (org.apache.hadoop.hbase.HBaseConfiguration). log4j:WARN Please initialize the log4j system properly. ``` 这通常是因为缺少有效的 `log4j.properties` 文件配置或者未正确加载该文件所致[^2]。 ##### 解决方法 - 将 `log4j.properties` 文件放置到项目的类路径下(通常是 `src/main/resources/` 或者项目根目录下的 `conf/` 文件夹)。 - 配置一个简单的 `log4j.properties` 文件如下所示: ```properties # Set root category priority to WARN and its only appender to CONSOLE. log4j.rootLogger=WARN, CONSOLE # ConsoleAppender configuration log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n ``` 如果仍然无法正常工作,则可以尝试通过 JVM 参数指定 `log4j.properties` 文件的位置: ```bash -Dlog4j.configuration=file:/path/to/log4j.properties ``` 将其添加至 Eclipse 运行配置中的 VM 参数部分即可[^3]。 #### 2. **关于 NoSuchMethodError** 此错误表明当前使用的依赖库版本不兼容,具体表现为调用了不存在的方法或签名不同的方法。对于 `setRuleMechanism()` 方法引发的异常来说,可能涉及 Kerberos 认证机制的相关实现差异。 ##### 原因分析 此类问题一般源于不同版本间的 API 变更。例如,在某些较新的 Hadoop 版本中移除了旧版 Kerberos 支持函数,而您的代码仍试图访问这些已废弃的功能。 ##### 解决办法 更新所有相关 Maven POM.xml 文件内的依赖项以匹配一致性的最新稳定发行版本号;同时仔细阅读官方迁移指南来调整源码适应新接口定义标准[^4]。 另外一种快速验证方式就是单独隔离测试环境里仅保留最低限度必要组件组合情况下去重现并定位确切冲突点所在位置后再做针对性修改处理。 --- ### 示例代码片段展示如何设置日志级别及排除潜在冲突依赖关系管理策略 下面提供一段示例 Java 代码用于演示如何动态更改应用程序的日志记录等级以便调试期间获得更多细节信息: ```java import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class LoggingExample { private static final Logger LOGGER = LogManager.getLogger(LoggingExample.class); public static void main(String[] args) { // Change logging level programmatically if needed during development phase ((ch.qos.logback.classic.Logger)LOGGER).setLevel(ch.qos.logback.classic.Level.DEBUG); LOGGER.debug("This is a debug message."); LOGGER.info("This is an info message."); } } ``` 注意上述例子假设您正在使用 SLF4J 和 LogBack 组合作为基础架构而非原始 Apache Log4j 实现形式因此需相应调整实际部署场景适配需求[^5]. ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值