1. 程式人生 > >mysql導入到hdfs中常見問題

mysql導入到hdfs中常見問題

nec chkconfig user for list oot username exc iptable

mysql導入到hdfs中命令:
sqoop import --connect jdbc:mysql://192.168.0.161:3306/angel --username anqi -password anqi --table test2 --fields-terminated-by ‘\t‘ -m 1

常見問題1:
Warning: /opt/cloudera/parcels/CDH-5.12.0-1.cdh5.12.0.p0.29/bin/../lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
解決:
mkdir /var/lib/accumulo
export ACCUMULO_HOME=/var/lib/accumulo

常見問題2:
17/09/14 17:02:17 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: java.sql.SQLException: Access denied for user ‘root‘@‘vm3‘ (using password: YES)
java.lang.RuntimeException: java.sql.SQLException: Access denied for user ‘root‘@‘vm3‘ (using password: YES)
解決:
不可使用mysql的root用戶。使用其他用戶例如1句中的root改為2句中的anqi
sqoop list-tables --connect jdbc:mysql://192.168.0.161:3306/angel --username root -password mysql
sqoop list-tables --connect jdbc:mysql://192.168.0.161:3306/angel --username anqi -password anqi

常見問題3:
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x
不可用linux的root用戶執行導入命令
su hdfs 再執行sqoop import

常見問題4:
java.io.IOException: Bad connect ack with firstBadLink as 192.168.0.109:50010
解決:
關閉防火墻
service iptables stop (臨時關閉)
chkconfig iptables off (重啟後生效)

mysql導入到hdfs中常見問題