Sqoop抽取数据到MySQL时遇到的问题
程序员文章站
2022-05-09 18:26:21
背景
对数据进行标准的ETL流程的操作
Sqoop ==data==> Hive ETL==sqoop==> MySQL
xxx.properties文件
mysql_...
背景
对数据进行标准的ETL流程的操作
Sqoop ==data==> Hive ETL==sqoop==> MySQL
xxx.properties文件
mysql_driver="jdbc:mysql://localhost:3306/ruozedata_bi" mysql_username="root" mysql_password="root" driver_rep="jdbc:mysql://localhost:3306/bireport?useUnicode=true&characterEncoding=utf8" username_rep="root" password_rep="root" HOSTNAME="localhost" PORT="3306" USERNAME="root" PASSWORD="root" DBNAME="bireport" tables=ruozedata_operatetrendandcity_rep,ruozedata_dealcompany_rep
第一次报错
The driver has not received any packets from the server.
大概意思是mysql连接超时,解决步骤:
修改driver_rep:
jdbc:mysql://localhost:3306//bireport?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
修改/etc/my.cnf
wait_timeout=31536000
interactive_timeout=31536000
重启mysql
没有效果,再度报错:
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:341) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2104) ... 31 more Caused by: java.net.UnknownHostException: localshot at java.net.InetAddress.getAllByName0(InetAddress.java:1259) at java.net.InetAddress.getAllByName(InetAddress.java:1171) at java.net.InetAddress.getAllByName(InetAddress.java:1105) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:188) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:300)
定位到原因:Caused by: java.net.UnknownHostException: localshot
修改localhost为机器的ip即可
推荐阅读
-
关于VS2005中C#代码用F12转到定义时,总是显示从元数据的问题
-
使用wordpress的$wpdb类读mysql数据库做ajax时出现的问题该如何解决
-
Mysql升级到5.7后遇到的group by查询问题解决
-
nodejs同步调用获取mysql数据时遇到的大坑
-
Python中LOADDATAINFILE语句导入数据到MySQL遇到问题的解决方案分享
-
安装SQL数据库时遇到问题。需要更新以前的visual studio 2010实例
-
Sqoop抽取数据到MySQL时遇到的问题
-
对于使用JDBC连接mysql数据时The server time zone value '¤¤°ê¼Ð·Ç®É¶¡'...的异常问题解决。
-
PHP进行数据库操作时遇到的一个问题
-
在连接mysql时遇到的问题及解决(SSM)