yarn執行MapReduce任務時,找不到主類致使的app
解決:oop
一、在命令行輸入:hadoop classpathspa
[hadoop@localhost ~]$ hadoop classpath /data/hadoop/hadoop//etc/hadoop:/data/hadoop/hadoop//share/hadoop/common/lib/*:/data/hadoop/hadoop//share/hadoop/common/*:/data/hadoop/hadoop//share/hadoop/hdfs:/data/hadoop/hadoop//share/hadoop/hdfs/lib/*:/data/hadoop/hadoop//share/hadoop/hdfs/*:/data/hadoop/hadoop//share/hadoop/mapreduce/lib/*:/data/hadoop/hadoop//share/hadoop/mapreduce/*:/data/hadoop/hadoop//share/hadoop/yarn:/data/hadoop/hadoop//share/hadoop/yarn/lib/*:/data/hadoop/hadoop//share/hadoop/yarn/*
二、把上述輸出的值添加到yarn-site.xml文件對應的屬性 <name>yarn.application.classpath</name>下面,eg:命令行
<property> <name>yarn.application.classpath</name> <value>/data/hadoop/hadoop//etc/hadoop:/data/hadoop/hadoop//share/hadooo p/common/lib/*:/data/hadoop/hadoop//share/hadoop/common/*:/data/hadoop/hadoop//ss hare/hadoop/hdfs:/data/hadoop/hadoop//share/hadoop/hdfs/lib/*:/data/hadoop/hadooo p//share/hadoop/hdfs/*:/data/hadoop/hadoop//share/hadoop/mapreduce/lib/*:/data/hh adoop/hadoop//share/hadoop/mapreduce/*:/data/hadoop/hadoop//share/hadoop/yarn:/dd ata/hadoop/hadoop//share/hadoop/yarn/lib/*:/data/hadoop/hadoop//share/hadoop/yarr n/*</value> </property>
三、重啓yarn,從新跑MapReduce任務。code