1 报错信息
错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster
说明:
操作将数据库中的数据导入到HDFS中
执行sqoop import --connect jdbc:mysql://aaa01:3306/mysql --username root --password root --table test 时报了以下错误
2 报错截图:
3 解决步骤
(首先正常关闭集群)
1.输出路径信息(运行代码)
hadoop classpath
会输出相应的路径信息
[hadoop@aaa01 ~]$ hadoop classpath /opt/modules/hadoop-3.1.3//etc/hadoop:/opt/modules/hadoop-3.1.3//share/hadoop/common/lib/*:/opt/modules/hadoop-3.1.3//share/hadoop/common/*:/opt/modules/hadoop-3.1.3//share/hadoop/hdfs:/opt/modules/hadoop-3.1.3//share/hadoop/hdfs/lib/*:/opt/modules/hadoop-3.1.3//share/hadoop/hdfs/*:/opt/modules/hadoop-3.1.3//share/hadoop/mapreduce/lib/*:/opt/modules/hadoop-3.1.3//share/hadoop/mapreduce/*:/opt/modules/hadoop-3.1.3//share/hadoop/yarn:/opt/modules/hadoop-3.1.3//share/hadoop/yarn/lib/*:/opt/modules/hadoop-3.1.3//share/hadoop/yarn/*
2.复制上面输出的路径,添加到hadoop下面的yarn-site.xml里面
<property> <name>yarn.application.classpath</name> <value>你的路径信息(上面复制的路径信息)</value> </property>
3.完成后重启集群
注:在其他帖子上看到是每个节点都要添加相应的信息(上述2操作),但我只在主节点里对应地方添加上就可以执行了
start-all.sh
zkServer.sh start
start-hbase.sh
4.继续运行命令
sqoop import --connect jdbc:mysql://aaa01:3306/mysql --username root --password root --table test,结果未报错,成功解决
标签:opt,主类,share,app,sqoop,modules,hadoop,--,3.1 From: https://blog.csdn.net/m0_68467925/article/details/137597464