-
报错信息截图
-
解决措施
按提示所言,相关的类路径信息不全
-
获取所有的类路径
hadoop classpath
-
然后在
etc/hadoop/mapred-site.xml
中加入下面这个标签。其中<value>
里面的值就是上面hadoop classpath
运行后的输出内容<property> <name>mapreduce.application.classpath</name> <value>/opt/software/hadoop-3.1.3/etc/hadoop:/opt/software/hadoop-3.1.3/share/hadoop/common/lib/*:/opt/software/hadoop-3.1.3/share/hadoop/common/*:/opt/software/hadoop-3.1.3/share/hadoop/hdfs:/opt/software/hadoop-3.1.3/share/hadoop/hdfs/lib/*:/opt/software/hadoop-3.1.3/share/hadoop/hdfs/*:/opt/software/hadoop-3.1.3/share/hadoop/mapreduce/lib/*:/opt/software/hadoop-3.1.3/share/hadoop/mapreduce/*:/opt/software/hadoop-3.1.3/share/hadoop/yarn:/opt/software/hadoop-3.1.3/share/hadoop/yarn/lib/*:/opt/software/hadoop-3.1.3/share/hadoop/yarn/*</value> </property>
-
完美解决
-