Sqoop拒绝连接错误

使用Sqoop远程连接MySQL导入数据到HBase数据库:

sqoop import --driver com.mysql.jdbc.Driver --connect "jdbc:mysql://hzhiServer:3306/myssh?autoReconnect=true" --table table_001 --username hadoop --password 1 --hbase-table table_001 --column-family rcgl --hbase-row-key CHANNELID --hbase-create-table

出现了拒绝连接的错误:

Error: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    at org.apache.sqoop.mapreduce.db.DBInputFormat.setDbConf(DBInputFormat.java:170)
    at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:161)
    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:749)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
    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:1698)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:223)
    at org.apache.sqoop.mapreduce.db.DBInputFormat.setDbConf(DBInputFormat.java:168)
    ... 10 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    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:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.Util.getInstance(Util.java:408)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2163)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2088)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    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:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at org.apache.sqoop.mapreduce.db.DBConfiguration.getConnection(DBConfiguration.java:302)
    at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:216)
    ... 11 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

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:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2104)
    ... 25 more
Caused by: java.net.ConnectException: 拒绝连接 (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
    ... 27 more

把主机名换成IP地址就正常了。

时间: 2024-10-20 04:49:39

Sqoop拒绝连接错误的相关文章

mysql远程连接拒绝连接错误

mysql -u root -p mysql>use mysql; mysql>select 'host' from user where user='root'; mysql>update user set host = '%' where user ='root'; mysql>flush privileges; mysql>select 'host'  from user where user='root'; 第一句是以权限用户root登录 第二句:选择mysql库 第

Linux无法连接上127.0.0.1,拒绝连接,更新时提示无法下载,无法正常使用apt-get update

你是否遇到过这种情况,在Linux以apt-get update 时更新的时候无法更新,提示一下内容 p { margin-bottom: 0.25cm; line-height: 120% } 错误:1 http://ppa.launchpad.net/diesch/testing/ubuntu zesty InRelease 无法连接上 127.0.0.1:42165 (127.0.0.1). - connect (111: 拒绝连接) 错误:2 http://archive.ubuntuk

php mysql 由于目标计算机积极拒绝,无法连接 错误原因

除了在网上百度的那些外,我的机器发生了这个错误 我需要用php远程连接mysql,在目标机上已经给了客户机权限,可是还是发生“ 由于目标计算机积极拒绝,无法连接”错误 在客户机上直接用终端连接目标机的mysql是发生错误是Can't connect to MySQL server on '*.*.*.*' (111) 用netstat -tanp查看开放的端口后发现3306端口也就是mysql的监听端口只能监听127.0.0.1,也就是本机,于是怀疑是端口监听问题,其实之前一直怀疑是防火墙问题,

HDFS文件上传:8020端口拒绝连接问题解决!

HDFS文件上传:8020端口拒绝连接问题解决! CopyFromLocal: Call to localhost/127.0.0.1:8020 failed on connection exception:      java.net.ConnectException 问题提示本机的8020端口无法连接. 网络上面找到一篇文章是将core-site.xml里面的配置端口修改成8020,但是我们现在依然用他默认的9000端口,只需要在配置eclipse的时候端口修改为9000就可以了. 我的问题

SQLServer2005+附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法

SQLServer2005+ 附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法 我们在用Sql SQLServer2005+附加数据库文件时弹出错误信息如下图的处理办法: 方案一:切换登录方式 出现这种情况是由于用"混合验证方式"(SQL Server身份验证)登录数据库造成的,只要将登录方式改为"windows身份验证方式"登录即可解决该问题,附加成功后再换用"混合验证模式"登陆就没问题了. 方案二:修改服务 选择 所有程序

mysql连接错误解决(ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option &#39;secure_auth&#39; enabled))

当使用mysql的新版本是,连接老版本的mysql,就会有可能报: ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)这个错误. 异常原因在于服务器端的密码管理协议陈旧,使用的是旧有的用户密码格式存储:但是客户端升级之后采用了新的密码格式.mysql新版本遇到这种不一致的情况就会拒绝连接. 所以在连接是:

Citrix Studio问题:验证中央配置服务位置失败。原因:数据库已拒绝连接

本文主要用于解决基于Alwayson的SQL数据库的情况下,Citrix Studio出现以下错误:错误:验证中央配置服务位置失败.在指定位置找不到有效的Delivery Controller服务.原因:数据库已拒绝连接 我遇到问题前,正好对数据库进行了一次操作,然后对数据库服务进行了重启,重启时优先重启了alwayson主要的数据库,导致了一次alwayson故障转移.让本来是备用的数据库变成了主要的.不过问题在于,虽然两个数据库的内容一样,但是数据库中的登录账户不是同步的,辅助的数据库中缺少

mysql连接错误导致用户blocked

1.每过一段时间线上业务就会出现如下错误: kHost 'XXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host 2.需要使用mysqladmin flush-hosts解锁用户 3.查看错误日志 4.查看官方文档对max_connect_errors的解释如下     当某用户连续的错误连接达到max_c

vc++ 编译连接错误and解决方法

1. LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol [email protected] Debug/lizi.exe : [分析]: 项目创建错误,因该选择Win32 Console Project,而不是 Win32 Projectvc++ 编译连接错误and解决方法,布布扣,bubuko.com