hiveserver2的10000端口启动不了

通过 docker-compose 来启动 hive,遇到 hiveserver2 的 10000 端口启动失败,问题报错原因为 beeline 连接 10000 端口报错 connection refused。通过 net-tools 的 netstat -nlp|grep 10000,发现 10000 端口根本没有启动,尝试了很多方式比如

出错现象为:

Could not open connection to jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (state=08S01,code=0)

1
2
3
4
5
<property>
    <name>hive.server2.thrift.bind.host</name>
    <value>10.10.22.133</value>
    <description>Bind host on which to run the HiveServer2 Thrift service.</description>
  </property>

这个没有解决 10000 端口没有启动,所以查问题,应该找到 hive.log 这个文件,查看是否 hive 启动成功,登录到容器内部发现 hive 的报错日志

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
WARN [main] metastore.RetryingMetaStoreClient: MetaStoreClient lost connection. Attempting to reconnect (1 of 1) after 1s. getCurrentNotificationEventId
org.apache.thrift.TApplicationException: Internal error processing get_current_notificationEventId
at org.apache.thrift.TApplicationException.read(TApplicationException.java:111) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:79) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_get_current_notificationEventId(ThriftHiveMetastore.java:5541) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_current_notificationEventId(ThriftHiveMetastore.java:5529) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getCurrentNotificationEventId(HiveMetaStoreClient.java:2713) ~[hive-exec-3.0.0.jar:3.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212) ~[hive-exec-3.0.0.jar:3.0.0]
at com.sun.proxy.$Proxy34.getCurrentNotificationEventId(Unknown Source) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2763) ~[hive-exec-3.0.0.jar:3.0.0]
at com.sun.proxy.$Proxy34.getCurrentNotificationEventId(Unknown Source) ~[?:?]
。。。。。。
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
at org.apache.hadoop.util.RunJar.run(RunJar.java:226) [hadoop-common-2.7.7.jar:?]
at org.apache.hadoop.util.RunJar.main(RunJar.java:141) [hadoop-common-2.7.7.jar:?]
Caused by: java.io.IOException: org.apache.thrift.TApplicationException: Internal error processing get_current_notificationEventId
at org.apache.hadoop.hive.metastore.messaging.EventUtils$MSClientNotificationFetcher.getCurrentNotificationEventId(EventUtils.java:75) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hadoop.hive.ql.metadata.events.NotificationEventPoll.<init>(NotificationEventPoll.java:103) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hadoop.hive.ql.metadata.events.NotificationEventPoll.initialize(NotificationEventPoll.java:59) ~[hive-exec-3.0.0.jar:3.0.0]
at org.apache.hive.service.server.HiveServer2.init(HiveServer2.java:267) ~[hive-service-3.0.0.jar:3.0.0]
... 10 more
Caused by: org.apache.thrift.TApplicationException: Internal error processing get_current_notificationEventId

解决方法:

修改 hive-site.xml 添加(我用的这个方式 问题解决)

1
2
3
4
<property>
    <name>hive.metastore.event.db.notification.api.auth</name>
    <value>false</value>
  </property>

或者:

hadoop core-site.xml 添加

1
2
hadoop.proxyuser.hive.hosts=HS2_HOST
hadoop.proxyuser.hive.groups=*

继续启动并监控日志

查看日志发现启动 10000 端口。

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up