当前位置:网站首页 > 编程语言 > 正文

kubelet启动不了(kubelet起不来)



1. 问题

在运行 Hive SQL 程序时抛出异常,查看 YARN 的 resourcemanager 日志发现如下异常:

2024-06-09 19:09:36,268 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: Application application_58_0002 failed 2 times due to AM Container for appattempt_58_0002_000002 exited with exitCode: 1

Failing this attempt.Diagnostics: [2024-06-09 19:09:36.249]Exception from container-launch.

Container id: container_58_0002_02_000001

Exit code: 1

[2024-06-09 19:09:36.250]Container exited with a non-zero exit code 1. Error file: prelaunch.err.

Last 4096 bytes of prelaunch.err :

Last 4096 bytes of stderr :

错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster

[2024-06-09 19:09:36.250]Container exited with a non-zero exit code 1. Error file: prelaunch.err.

Last 4096 bytes of prelaunch.err :

Last 4096 bytes of stderr :

错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster

For more detailed output, check the application tracking page: http://localhost:8088/cluster/app/application_58_0002 Then click on links to logs of each attempt.

. Failing the application.

2. 解决方案

这个错误通常发生在使用 Hadoop 启动 MapReduce 作业时。它表示 Hadoop 无法找到或加载用于作业的主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster。一般是类路径(Classpath)设置不正确,导致 Hadoop 无法找到相应的类。在 Hadoop 的配置文件 mapred-site.xml 中,mapreduce.application.classpath 项的作用是指定 MapReduce 作业在运行时查找所需 Java 类的 classpath。查看配置文件中 mapreduce.application.classpath 项发现确实配置有问题。那如何配置 mapreduce.application.classpath 项呢?通常会被设置为包含 Hadoop 核心库和常用的第三方库路径的表达式,确保 JVM 启动 MapReduce 作业时能加载到必要的类。可以通过执行 hadoop classpath 命令查看具体的 classpath:

(base) localhost:hadoop wy$ hadoop classpath

/opt/hadoop-2.10.1/etc/hadoop:/opt/hadoop-2.10.1/share/hadoop/common/lib/*:/opt/hadoop-2.10.1/share/hadoop/common/*:/opt/hadoop-2.10.1/share/hadoop/hdfs:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/*:/opt/hadoop-2.10.1/share/hadoop/hdfs/*:/opt/hadoop-2.10.1/share/hadoop/yarn:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/*:/opt/hadoop-2.10.1/share/hadoop/yarn/*:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/*:/opt/hadoop-2.10.1/share/hadoop/mapreduce/*:/opt/hadoop-2.10.1/etc/hadoop:/opt/hadoop-2.10.1/share/hadoop/common/lib/*:/opt/hadoop-2.10.1/share/hadoop/common/*:/opt/hadoop-2.10.1/share/hadoop/hdfs:/opt/hadoop-2.10.1/share/hadoop/hdfs/lib/*:/opt/hadoop-2.10.1/share/hadoop/hdfs/*:/opt/hadoop-2.10.1/share/hadoop/yarn:/opt/hadoop-2.10.1/share/hadoop/yarn/lib/*:/opt/hadoop-2.10.1/share/hadoop/yarn/*:/opt/hadoop-2.10.1/share/hadoop/mapreduce/lib/*:/opt/hadoop-2.10.1/share/hadoop/mapreduce/*:/opt/hadoop/contrib/capacity-scheduler/*.jar:/opt/hadoop/contrib/capacity-scheduler/*.jar

然后将 mapreduce.application.classpath 项修改为上述 classpath 如下所示:

mapreduce.application.classpath

$HADOOP_HOME/etc/hadoop:$HADOOP_HOME/share/hadoop/common/lib/*:$HADOOP_HOME/share/hadoop/common/*:$HADOOP_HOME/share/hadoop/hdfs:$HADOOP_HOME/share/hadoop/hdfs/lib/*:$HADOOP_HOME/share/hadoop/hdfs/*:$HADOOP_HOME/share/hadoop/yarn:$HADOOP_HOME/share/hadoop/yarn/lib/*:$HADOOP_HOME/share/hadoop/yarn/*:$HADOOP_HOME/share/hadoop/mapreduce/lib/*:$HADOOP_HOME/share/hadoop/mapreduce/*:$HADOOP_HOME/etc/hadoop:$HADOOP_HOME/share/hadoop/common/lib/*:$HADOOP_HOME/share/hadoop/common/*:$HADOOP_HOME/share/hadoop/hdfs:$HADOOP_HOME/share/hadoop/hdfs/lib/*:$HADOOP_HOME/share/hadoop/hdfs/*:$HADOOP_HOME/share/hadoop/yarn:$HADOOP_HOME/share/hadoop/yarn/lib/*:$HADOOP_HOME/share/hadoop/yarn/*:$HADOOP_HOME/share/hadoop/mapreduce/lib/*:$HADOOP_HOME/share/hadoop/mapreduce/*:/opt/hadoop/contrib/capacity-scheduler/*.jar:/opt/hadoop/contrib/capacity-scheduler/*.jar

需要注意的是修改classpath时,要确保新增加的路径不会引起类冲突或覆盖已有的类定义。在大型集群中,确保所有节点的 Hadoop 配置同步,以防止运行时故障。

设置完毕后重启 Hadoop 集群,重新运行刚才的 MapReduce 程序,成功运行。

参考阅读

  

/br>

br>

hadoop:hadoop集群搭建

到此这篇kubelet启动不了(kubelet起不来)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • 虚拟机安装xp系统按f8没反应(虚拟机中装xp系统)2025-01-12 10:54:08
  • 字体图标不显示怎么办(字体图标不显示怎么办苹果)2025-01-12 10:54:08
  • ngffm2接口(ngff2242接口)2025-01-12 10:54:08
  • sigmoid输出范围(sigmoid的输出)2025-01-12 10:54:08
  • wifite 字典(wifite字典位置)2025-01-12 10:54:08
  • mt103报文52d项(mt103报文53a)2025-01-12 10:54:08
  • 手机输入的字怎么变颜色(手机输入的字怎么变颜色字体)2025-01-12 10:54:08
  • 下载安装包需要读写文件权限怎么办(下载文件后安装包还需要留下来吗)2025-01-12 10:54:08
  • 工具类英文单词(工具类英文单词有哪些)2025-01-12 10:54:08
  • 工具类(工具类五金)2025-01-12 10:54:08
  • 全屏图片