sqoop连接mysql出现 Communications link failure

来源:互联网 发布:php支付接口开发demo 编辑:程序博客网 时间:2024/06/16 03:09

错误

Error: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.    at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:167)    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:746)    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)    at java.security.AccessController.doPrivileged(Native Method)    at javax.security.auth.Subject.doAs(Subject.java:422)    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1656)    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

解决

网上找了不少资料,都说是mysql连接池的问题,但是用jdbc却可以连接,应该不是连接池的问题,也没有去修改
最后将mysql与sqoop分配在不同的节点,顺利解决

0 0