赞
踩
日志报错内容:Caused by:java.lang.ClassNotFoundException:org.apache.hadoop.yarn.exceptions.YarnRuntimeException at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) … 7 more
本人初学hadoop,是按照尚硅谷的b站视频学习,也是按照尚硅谷的配置文档配置的yarn-site.sml等等,但是到我运行wordcount就报错。现把我修改的地方大家可以在做个对比(仅针对我修改的文档做对比,未修改的地方就按照尚硅谷的资料来配置)。
1:yarn-site.xml
<configuration> <!-- 指定 MR 走 shuffle --> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <!-- 指定 ResourceManager 的地址--> <property> <name>yarn.resourcemanager.hostname</name> <value>hadoop103</value> </property> <!-- 环境变量的继承 --> <property> <name>yarn.nodemanager.env-whitelist</name> <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CO NF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAP RED_HOME</value> </property> <!-- 开启日志聚集功能 --> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <!-- 设置日志聚集服务器地址 --> <property> <name>yarn.log.server.url</name> <value>http://hadoop102:19888/jobhistory/logs</value> </property> <!-- 设置日志保留时间为 7 天 --> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>604800</value> </property> </configuration>
2:mapred-site.xml
<!-- 历史服务器端地址 -->
<property>
<name>mapreduce.jobhistory.address</name>
<value>hadoop102:10020</value>
</property>
<!-- 历史服务器 web 端地址 -->
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>hadoop102:19888</value>
</property>
1:yarn-site.xml
<configuration> <!-- 指定 MR 走 shuffle --> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <!-- 指定 ResourceManager 的地址--> <property> <name>yarn.resourcemanager.hostname</name> <value>hadoop103</value> </property> <!-- 环境变量的继承 --> <property> <name>yarn.nodemanager.env-whitelist</name> <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR, CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAPRED_HOME</value> </property> <property> <name>yarn.application.classpath</name> <value> $HADOOP_CONF_DIR, $HADOOP_COMMON_HOME/share/hadoop/common/*, $HADOOP_COMMON_HOME/share/hadoop/common/lib/*, $HADOOP_HDFS_HOME/share/hadoop/hdfs/*, $HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*, $YARN_HOME/share/hadoop/yarn/* $YARN_HOME/share/hadoop/yarn/lib/* $YARN_HOME/share/hadoop/mapreduce/*, $YARN_HOME/share/hadoop/mapreduce/lib/* export HADOOP_MAPRED_HOME=$HADOOP_HOME export HADOOP_COMMON_HOME=$HADOOP_HOME export HADOOP_HDFS_HOME=$HADOOP_HOME export YARN_HOME=$HADOOP_HOME export HADOOP_YARN_HOME=$HADOOP_HOME export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop export HDFS_CONF_DIR=$HADOOP_HOME/etc/hadoop export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop </value> </property> <property> <name>yarn.application.classpath</name> <value> /opt/module/hadoop-3.1.3/etc/*, /opt/module/hadoop-3.1.3/etc/hadoop/*, /opt/module/hadoop-3.1.3/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/common/*, /opt/module/hadoop-3.1.3/share/hadoop/common/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/*, /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/lib-examples/*, /opt/module/hadoop-3.1.3/share/hadoop/hdfs/*, /opt/module/hadoop-3.1.3/share/hadoop/hdfs/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/yarn/*, /opt/module/hadoop-3.1.3/share/hadoop/yarn/lib/* </value> </property> <!-- 开启日志聚集功能 --> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <!-- 设置日志聚集服务器地址 --> <property> <name>yarn.log.server.url</name> <value>http://hadoop102:19888/jobhistory/logs</value> </property> <!-- 设置日志保留时间为 7 天 --> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>604800</value> </property> </configuration>
2:marped-site.xml
<configuration> <!-- 指定 MapReduce 程序运行在 Yarn 上 --> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> <property> <name>yarn.app.mapreduce.am.env</name> <value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value> </property> <property> <name>mapreduce.application.classpath</name> <value> /opt/module/hadoop-3.1.3/etc/*, /opt/module/hadoop-3.1.3/etc/hadoop/*, /opt/module/hadoop-3.1.3/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/common/*, /opt/module/hadoop-3.1.3/share/hadoop/common/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/*, /opt/module/hadoop-3.1.3/share/hadoop/mapreduce/lib-examples/*, /opt/module/hadoop-3.1.3/share/hadoop/hdfs/*, /opt/module/hadoop-3.1.3/share/hadoop/hdfs/lib/*, /opt/module/hadoop-3.1.3/share/hadoop/yarn/*, /opt/module/hadoop-3.1.3/share/hadoop/yarn/lib/*,x </value> </property> <!-- 历史服务器端地址 --> <property> <name>mapreduce.jobhistory.address</name> <value>hadoop102:10020</value> </property> <!-- 历史服务器 web 端地址 --> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>hadoop102:19888</value> </property> </configuration>
遇到同样问题的童鞋可以试一下,具体原因我也不懂。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。