使sqoop1与hadoop2协同工作

50few1ms  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(326)

我很难让sqoop1在hadoop2上工作。我总是跑步 Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.Tool 错误,表明sqoop1正在尝试使用hadoop1。但是我已经从下载了带有hadoop2.0.4-alpha版本的sqoop1jarhttp://www.us.apache.org/dist/sqoop/1.4.5/.
那为什么它不能和hadoop2一起工作呢?
ps:我努力使sqoop2工作,但在设置中遇到了很多问题。
还有,这个帖子http://mmicky.blog.163.com/blog/static/1502901542013118115417262/ 建议它应该工作,但我一直遇到这个classnotfoundexception。

y53ybaqx

y53ybaqx1#

我解决了问题。我设置的任何类路径都可能被hadoop可执行文件覆盖。所以我不得不在调用java命令的地方修改hadoop可执行文件,并在hadoop jar的类路径中添加-cp标志,如下所示:
exec“$java”-cp“$classpath:/usr/local/cell/hadoop/2.4.1/libexec/share/hadoop/common/:/usr/local/cell/hadoop/2.4.1/libexec/share/hadoop/common/lib/:/usr/local/cell/hadoop/2.4.1/libexec/share/hadoop/hdfs/:/usr/local cell/hadoop/2.4.1/libexec/share/hadoop/hdfs/lib/:/usr/local/cell/hadoop/2.4.1/libexec/share/hadoop/mapreduce/:/usr/local cell/hadoop/2.4.1”/libexec/share/hadoop/mapreduce/lib/:/usr/local/cillar/hadoop/2.4.1/libexec/share/hadoop/tools/:/usr/local/cillar/hadoop/2.4.1/libexec/share/hadoop/tools/lib/:/usr/local/cillar/hadoop/2.4.1/libexec/share/hadoop/yarn/:/usr/local/cillar/hadoop/2.4.1/libexec/share/hadoop/yarn/lib/“$java\u heap\max$hadoop\opts$class”$@“

相关问题