sqoop2启动job报错

set option --name verbose --value true   #打开报错详情输出

 

Exception has occurred during processing command 
Exception: org.apache.sqoop.common.SqoopException Message: GENERIC_HDFS_CONNECTOR_0007:Invalid input/output directory - Unexpected exception

解决方法:

安装配置参考的:http://www.cnblogs.com/duking1991/p/6081118.html
hadoop的用户代理机制:http://blog.csdn.net/u012948976/article/details/49904675
我配置的代理访问:
<property>
  <name>hadoop.proxyuser.root.hosts</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.root.groups</name>
  <value>*</value>
</property>

 

 

Caused by: Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"company"."erp_achievement_analysis"' at line 1

解决: 在创建mysql链接时,Identifier enclose:指定SQL中标识符的定界符,也就是说,有的SQL标示符是一个引号:select * from "table_name",这种定界符在MySQL中是会报错的。这个属性默认值就是双引号,所以不能使用回车,必须将之覆盖,我使用空格覆盖了这个值。吐槽一下,这个错误我整了一整天才搞明白,官方文档也是坑啊! 所以修改下mysql的link吧。

 

 

Caused by: Exception: java.lang.Throwable Message: User: root is not allowed to impersonate root

解决方法: core-site.xml加入:

<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
</configuration>

 

查看job执行情况报错:

 status job -n test

Exception: org.apache.sqoop.common.SqoopException Message: MAPREDUCE_0003:Can't get RunningJob instance -

Caused by: Exception: java.io.IOException Message: java.net.ConnectException: Call From hadoop1/192.168.122.10 to 0.0.0.0:10020 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

解决方法:

表示: hadoop运行mapreduce作业无法连接0.0.0.0/0.0.0.0:10020

这个问题是由于没有启动historyserver引起的,解决办法:
在mapred-site.xml配置文件中添加:
<property>
    <name>mapreduce.jobhistory.address</name>
    <value>hadoop-allinone-200-123.wdcloud.locl:10020</value>
</property>
在namenode上执行命令:mr-jobhistory-daemon.sh start historyserver 
这样在,namenode上会启动JobHistoryServer服务,可以在historyserver的日志中查看运行情况
复制代码
[hadoop@hadoop-allinone-200-123 sbin]$ pwd
/wdcloud/app/hadoop-2.7.3/sbin

[hadoop@hadoop-allinone-200-123 sbin]$ ll | grep jobhistory
-rwxr-xr-x 1 hadoop hadoop 4080 Aug 17 21:49 mr-jobhistory-daemon.sh

[hadoop@hadoop-allinone-200-123 sbin]$ ./mr-jobhistory-daemon.sh start historyserver
starting historyserver, logging to /wdcloud/app/hadoop-2.7.3/logs/mapred-hadoop-historyserver-hadoop-allinone-200-123.wdcloud.locl.out

[hadoop@hadoop-allinone-200-123 sbin]$ jps | grep JobHistoryServer
16818 JobHistoryServer

 

posted @ 2018-11-14 11:03  天宇星空  阅读(1118)  评论(0编辑  收藏  举报