办理Hive启动报错:org.apache.thrift.transport.TTransportException: Can ...

打印 上一主题 下一主题

主题 656|帖子 656|积分 1968

在设置好hiveserver2和Metastore两个服务后使用脚本hive-server-manager.sh start启动服务
使用jps查看进程号发现进程完好运行:

然后实验使用DataGrip毗连hive显示毗连成功没有抛出任何错误:

此时我们以为万事具备使用DataGrip编写sql语句,发现实行select命令和建表语句都是可以正常运行的,但是当我们实行一堆插入语句的时候发现此时DataGrip报了一个这样的错误:

初步判断大概是由于hive中某些服务出现了问题然后我们回到黑窗口实验实行该语句发现它是可以正常走MapReduce程序并实行成功的:

然后我们实验重启hive所有服务查看默认在/tmp/root/下的hive.log文件,发现了如下错误:
  1. 2024-09-10T19:32:57,797 ERROR [pool-7-thread-1] utils.MetaStoreUtils: Got exception: org.apache.thrift.transport.TTransportException Cannot write to null outputStream
  2. org.apache.thrift.transport.TTransportException: Cannot write to null outputStream
  3.         at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142) ~[hive-exec-3.1.2.jar:3.1.2]
  4.         at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:178) ~[hive-exec-3.1.2.jar:3.1.2]
  5.         at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:106) ~[hive-exec-3.1.2.jar:3.1.2]
  6.         at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:70) ~[hive-exec-3.1.2.jar:3.1.2]
  7.         at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) ~[hive-exec-3.1.2.jar:3.1.2]
  8.         at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_get_tables_by_type(ThriftHiveMetastore.java:1913) ~[hive-exec-3.1.2.jar:3.1.2]
  9.         at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_tables_by_type(ThriftHiveMetastore.java:1903) ~[hive-exec-3.1.2.jar:3.1.2]
  10.         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1676) ~[hive-exec-3.1.2.jar:3.1.2]
  11.         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1665) ~[hive-exec-3.1.2.jar:3.1.2]
  12.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
  13.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
  14.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
  15.         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
  16.         at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212) ~[hive-exec-3.1.2.jar:3.1.2]
  17.         at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
  18.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
  19.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
  20.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
  21.         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
  22.         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2773) ~[hive-exec-3.1.2.jar:3.1.2]
  23.         at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
  24.         at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByType(Hive.java:1310) ~[hive-exec-3.1.2.jar:3.1.2]
  25.         at org.apache.hadoop.hive.ql.metadata.Hive.getTableObjects(Hive.java:1222) ~[hive-exec-3.1.2.jar:3.1.2]
  26.         at org.apache.hadoop.hive.ql.metadata.Hive.getAllMaterializedViewObjects(Hive.java:1217) ~[hive-exec-3.1.2.jar:3.1.2]
  27.         at org.apache.hadoop.hive.ql.metadata.HiveMaterializedViewsRegistry$Loader.run(HiveMaterializedViewsRegistry.java:166) ~[hive-exec-3.1.2.jar:3.1.2]
  28.         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
  29.         at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
  30.         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
  31.         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
  32.         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
  33. 2024-09-10T19:32:57,797 ERROR [pool-7-thread-1] utils.MetaStoreUtils: Converting exception to MetaException
  34. 2024-09-10T19:32:57,799  WARN [pool-7-thread-1] metastore.RetryingMetaStoreClient: MetaStoreClient lost connection. Attempting to reconnect (1 of 1) after 1s. getTables
  35. org.apache.hadoop.hive.metastore.api.MetaException: Got exception: org.apache.thrift.transport.TTransportException Cannot write to null outputStream
  36.         at org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.logAndThrowMetaException(MetaStoreUtils.java:168) ~[hive-exec-3.1.2.jar:3.1.2]
  37.         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1667) ~[hive-exec-3.1.2.jar:3.1.2]
  38.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
  39.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
  40.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
  41.         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
  42.         at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212) ~[hive-exec-3.1.2.jar:3.1.2]
  43.         at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
  44.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
  45.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
  46.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
  47.         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
  48.         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2773) ~[hive-exec-3.1.2.jar:3.1.2]
  49.         at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
  50.         at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByType(Hive.java:1310) ~[hive-exec-3.1.2.jar:3.1.2]
  51.         at org.apache.hadoop.hive.ql.metadata.Hive.getTableObjects(Hive.java:1222) ~[hive-exec-3.1.2.jar:3.1.2]
  52.         at org.apache.hadoop.hive.ql.metadata.Hive.getAllMaterializedViewObjects(Hive.java:1217) ~[hive-exec-3.1.2.jar:3.1.2]
  53.         at org.apache.hadoop.hive.ql.metadata.HiveMaterializedViewsRegistry$Loader.run(HiveMaterializedViewsRegistry.java:166) ~[hive-exec-3.1.2.jar:3.1.2]
  54.         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
  55.         at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
  56.         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
  57.         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
  58.         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
复制代码
在hive/conf/hive-site.xml下添加以下代码并重启hive的所有服务发现一切都可以恢复正常了:
<!-- hiveserver2的高可用参数,开启此参数可以提高hiveserver2的启动速率 -->
<property>
<name>hive.server2.active.passive.ha.enable</name>
<value>true</value>
</property>

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

用户国营

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表