mysql导入到hdfs中常见问题
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 (重启后生效)