[root@hadoop01 sbin]# yarn application -kill application_1655090665495_0013
Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI
[root@hadoop01 sbin]# yarn -kill application_1655090665495_0013
Unrecognized option: -kill
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[root@hadoop01 sbin]# hadoop job -kill application_1655090665495_0013
DEPRECATED: Use of this script to execute mapred command is deprecated.
Instead use the mapred command for it.
Error: Could not find or load main class org.apache.hadoop.mapred.JobClient
[root@hadoop01 sbin]# yarn application -list
Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI
[root@hadoop01 sbin]# yarn application -status
Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI
[root@hadoop01 sbin]# yarn app -status
Error: Could not find or load main class app
[root@hadoop01 sbin]# yarn applicationcli -status
Error: Could not find or load main class applicationcli
[root@hadoop01 sbin]# yarn application -status
Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI
[root@hadoop01 sbin]# hadoop job -kill application_1655090665495_0013
DEPRECATED: Use of this script to execute mapred command is deprecated.
Instead use the mapred command for it.
Error: Could not find or load main class org.apache.hadoop.mapred.JobClient
[root@hadoop01 sbin]# yarn application -kill application_1655090665495_0013 Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI [root@hadoop01 sbin]# yarn -kill application_1655090665495_0013 Unrecognized option: -kill Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. [root@hadoop01 sbin]# hadoop job -kill application_1655090665495_0013 DEPRECATED: Use of this script to execute mapred command is deprecated. Instead use the mapred command for it. Error: Could not find or load main class org.apache.hadoop.mapred.JobClient [root@hadoop01 sbin]# yarn application -list Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI [root@hadoop01 sbin]# yarn application -status Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI [root@hadoop01 sbin]# yarn app -status Error: Could not find or load main class app [root@hadoop01 sbin]# yarn applicationcli -status Error: Could not find or load main class applicationcli [root@hadoop01 sbin]# yarn application -status Error: Could not find or load main class org.apache.hadoop.yarn.client.cli.ApplicationCLI [root@hadoop01 sbin]# hadoop job -kill application_1655090665495_0013 DEPRECATED: Use of this script to execute mapred command is deprecated. Instead use the mapred command for it. Error: Could not find or load main class org.apache.hadoop.mapred.JobClient
查看hadoop classpath检查如下jar包路径,了解hadoop的看到这里就已经明白问题所在了
/usr/local/soft/hadoop-2.7.7/etc/hadoop, /usr/local/soft/hadoop-2.7.7/share/hadoop/common/lib/*, /usr/local/soft/hadoop-2.7.7/share/hadoop/common/*, /usr/local/soft/hadoop-2.7.7/share/hadoop/hdfs, /usr/local/soft/hadoop-2.7.7/share/hadoop/hdfs/lib/*, /usr/local/soft/hadoop-2.7.7/share/hadoop/hdfs/*, # /usr/hdp/2.6.5.0-292/hadoop-yarn/share/hadoop/yarn/*, # # /usr/hdp/2.6.5.0-292/hadoop-mapreduce/share/hadoop/mapreduce/*, # /usr/local/soft/hadoop-2.7.7/contrib/capacity-scheduler/*.jar
注释掉的两行与上面不是一个版本的,这是因为环境中存在多个版本的hadoop,且新版本的环境变量未生效,导致版本jar包加载混乱导致的
解决办法很简单,删除老版本,重新执行source刷新环境变量即可



