办理Hive启动报错:org.apache.thrift.transport.TTransportException: Can
在设置好hiveserver2和Metastore两个服务后使用脚本hive-server-manager.sh start启动服务使用jps查看进程号发现进程完好运行:
https://i-blog.csdnimg.cn/direct/422f36d018f34657b3635c4c5e600f69.png
然后实验使用DataGrip毗连hive显示毗连成功没有抛出任何错误:
https://i-blog.csdnimg.cn/direct/bec0ed60900746a7805dba82452ecafc.png
此时我们以为万事具备使用DataGrip编写sql语句,发现实行select命令和建表语句都是可以正常运行的,但是当我们实行一堆插入语句的时候发现此时DataGrip报了一个这样的错误:
https://i-blog.csdnimg.cn/direct/a242b825345743b3beb29feef36670a5.png
初步判断大概是由于hive中某些服务出现了问题然后我们回到黑窗口实验实行该语句发现它是可以正常走MapReduce程序并实行成功的:
https://i-blog.csdnimg.cn/direct/6df74bfb189a41dda7b026159fd967d4.png
然后我们实验重启hive所有服务查看默认在/tmp/root/下的hive.log文件,发现了如下错误:
2024-09-10T19:32:57,797 ERROR utils.MetaStoreUtils: Got exception: org.apache.thrift.transport.TTransportException Cannot write to null outputStream
org.apache.thrift.transport.TTransportException: Cannot write to null outputStream
at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142) ~
at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:178) ~
at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:106) ~
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:70) ~
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) ~
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_get_tables_by_type(ThriftHiveMetastore.java:1913) ~
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_tables_by_type(ThriftHiveMetastore.java:1903) ~
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1676) ~
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1665) ~
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212) ~
at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2773) ~
at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByType(Hive.java:1310) ~
at org.apache.hadoop.hive.ql.metadata.Hive.getTableObjects(Hive.java:1222) ~
at org.apache.hadoop.hive.ql.metadata.Hive.getAllMaterializedViewObjects(Hive.java:1217) ~
at org.apache.hadoop.hive.ql.metadata.HiveMaterializedViewsRegistry$Loader.run(HiveMaterializedViewsRegistry.java:166) ~
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
2024-09-10T19:32:57,797 ERROR utils.MetaStoreUtils: Converting exception to MetaException
2024-09-10T19:32:57,799WARN metastore.RetryingMetaStoreClient: MetaStoreClient lost connection. Attempting to reconnect (1 of 1) after 1s. getTables
org.apache.hadoop.hive.metastore.api.MetaException: Got exception: org.apache.thrift.transport.TTransportException Cannot write to null outputStream
at org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.logAndThrowMetaException(MetaStoreUtils.java:168) ~
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:1667) ~
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212) ~
at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2773) ~
at com.sun.proxy.$Proxy34.getTables(Unknown Source) ~[?:?]
at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByType(Hive.java:1310) ~
at org.apache.hadoop.hive.ql.metadata.Hive.getTableObjects(Hive.java:1222) ~
at org.apache.hadoop.hive.ql.metadata.Hive.getAllMaterializedViewObjects(Hive.java:1217) ~
at org.apache.hadoop.hive.ql.metadata.HiveMaterializedViewsRegistry$Loader.run(HiveMaterializedViewsRegistry.java:166) ~
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
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企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]