一次用sqoop抽取oracle数据到hive时遇到的问题
一次用sqoop抽取oracle数据到hive时遇到的问题
balajinima 发表于8个月前
一次用sqoop抽取oracle数据到hive时遇到的问题
  • 发表于 8个月前
  • 阅读 14
  • 收藏 0
  • 点赞 0
  • 评论 0

新睿云服务器60天免费使用,快来体验!>>>   

问题描述

抽取oracle中数据到hive时,报连接异常,如下:

Error: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLRecoverableException: Io exception: Connection reset

        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:1796)

        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

Caused by: java.lang.RuntimeException: java.sql.SQLRecoverableException: Io exception: Connection reset

        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: java.sql.SQLRecoverableException: Io exception: Connection reset

        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)

        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:521)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:418)

        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)

        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)

        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)

        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: java.net.SocketException: Connection reset

        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115)

        at java.net.SocketOutputStream.write(SocketOutputStream.java:155)

        at oracle.net.ns.DataPacket.send(DataPacket.java:150)

        at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:180)

        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:169)

        at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)

        at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)

        at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)

        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1034)

        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1010)

        at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:760)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:368)

        ... 19 more

 

按照sqoop官网的解决方案 添加参数 

-D mapred.child.java.opts="-Djava.security.egd=file:/dev/../dev/urandom"

问题没有得到解决,依然报错。

最后,将ojdbc6.jar 替换为 ojdbc14.jar ,异常不再有了。

 

不知道什么原因。

 

 

 

 

 

 

 

 

 

  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 3
博文 12
码字总数 22112
×
balajinima
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: