hiveserver2 org.apache.thrift.transport.TTransportException在一小段不活动后运行第二个查询时出错

时间:2018-04-05 00:48:45

标签: java hadoop hive bigdata thrift

我使用端口10000从我的SQL工具(即Squirrel SQL,Oracle SQL Developer)到HiveServer2(在远程服务器上运行)建立JDBC连接。

我能够成功运行一些查询。 然后我做了一些其他事情(不在SQL工具中)1-2分钟,然后返回我的SQL工具并尝试运行查询,但是我收到此错误:org.apache.thrift.transport.TTransportException: java.net.SocketException: Software caused connection abort: socket write error

如果我现在断开连接并重新连接我的SQL工具,我可以再次运行查询。但有谁知道我应该改变什么HiveServer2设置以防止错误?我在hive-site.xml中假设了一些东西

从下面的hiveserver2日志中,可以看到从第30分钟到第31分钟的确切1分钟间隙发生断开连接。

2018-04-05T03:30:41,706  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Resetting thread name to  HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:30:41,712  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Updating thread name to c81ec0f9-7a9d-46b6-9708-e7d78520a48a HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:30:41,712  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Resetting thread name to  HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:30:41,718  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Updating thread name to c81ec0f9-7a9d-46b6-9708-e7d78520a48a HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:30:41,719  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Resetting thread name to  HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:31:41,232  INFO [HiveServer2-Handler-Pool: Thread-36] thrift.ThriftCLIService: Session disconnected without closing properly.
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] thrift.ThriftCLIService: Closing the session: SessionHandle [c81ec0f9-7a9d-46b6-9708-e7d78520a48a]
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] service.CompositeService: Session closed, SessionHandle [c81ec0f9-7a9d-46b6-9708-e7d78520a48a], current sessions:0
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Updating thread name to c81ec0f9-7a9d-46b6-9708-e7d78520a48a HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Resetting thread name to  HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Updating thread name to c81ec0f9-7a9d-46b6-9708-e7d78520a48a HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] session.HiveSessionImpl: Operation log session directory is deleted: /var/hive/hs2log/tmp/c81ec0f9-7a9d-46b6-9708-e7d78520a48a
2018-04-05T03:31:41,233  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Resetting thread name to  HiveServer2-Handler-Pool: Thread-36
2018-04-05T03:31:41,236  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Deleted directory: /var/hive/scratch/tmp/anonymous/c81ec0f9-7a9d-46b6-9708-e7d78520a48a on fs with scheme file
2018-04-05T03:31:41,236  INFO [HiveServer2-Handler-Pool: Thread-36] session.SessionState: Deleted directory: /var/hive/ec2-user/c81ec0f9-7a9d-46b6-9708-e7d78520a48a on fs with scheme file
2018-04-05T03:31:41,236  INFO [HiveServer2-Handler-Pool: Thread-36] hive.metastore: Closed a connection to metastore, current connections: 1

环境:

  • Hive 2.1.1,hive.server2.transport.mode设置为二进制(示例JDBC字符串为jdbc:hive2:// remotehost:10000 / default)
  • Hadoop 2.8.3
  • 使用MySQL的Metastore
  • Java 8

1 个答案:

答案 0 :(得分:0)

  1. 将AWS ELB的默认超时从1分钟更改为20分钟
  2. 将SimbaHive驱动程序与Squirrel一起使用(无超时),或将标准apache hive2驱动程序与IBM数据工作室一起使用(无超时)