hiveserver2.log 日志报错:
026-10-09T08:02:35,471 INFO HiveServer2-Background-Pool: Thread-5733502: metastore.RetryingMetaStoreClient (😦)) - RetryingMetaStoreClient proxy=class org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient ugi=wf_bpit_30 (auth:PROXY) via hive/wf-gd2-bpit-dp-nn-17-71@GOERTEK.COM (auth:KERBEROS) retries=24 delay=5 lifetime=0
2026-10-09T08:02:35,472 ERROR HiveServer2-Handler-Pool: Thread-5732992: metadata.Hive (😦)) - MetaException(message:org.apache.hadoop.hive.metastore.security.DelegationTokenStore$TokenStoreException: Error creating new node with path /hive/cluster/delegationMETASTORE/tokens/AAt3Zl9icGl0X2dwcwt3Zl9icGl0X2dwcyhoaXZlL3dmLWdkMi1icGl0LWRwLW5uLTE3LTcxQEdPRVJURUsuQ09NigGhHffk3IoBoUIEaNyNB02QjgpH)
zk 客户端执行报错:
ls /hive/cluster/delegationMETASTORE/tokens
2026-10-09 09:09:37,589 myid:wf-gd2-bpit-dp-nn-17-70:2181 - WARN main-SendThread(wf-gd2-bpit-dp-nn-17-70:2181)😮.a.z.ClientCnxn$SendThread@1302 - Session 0x20816154f96fa80 for server wf-gd2-bpit-dp-nn-17-70/10.11.17.70:2181, Closing socket connection. Attempting reconnect except it is a SessionExpiredException or SessionTimeoutException.
java.io.IOException: Packet len 116690678 is out of range!
处理方案:
1、修改Hive配置,轮询重启服务
ZooKeeper 节点路径拼接错误(缺少斜杠)
日志中的路径 /hive/cluster/delegationMETASTORE/tokens 存在明显的拼接错误,delegation 和 METASTORE 之间缺少斜杠。
已知的 Hive 配置问题(HIVE-15005)。当 hive.cluster.delegation.token.store.zookeeper.znode 配置项的值(例如 /hive/cluster/delegation)末尾没有斜杠时,Hive 在拼接 METASTORE 或 HIVESERVER2 等子目录时,就会生成上述错误路径!
修正 znode 路径配置(防止复发)在 hive-site.xml 中,确保路径末尾有斜杠:
hive.cluster.delegation.token.store.zookeeper.znode
/hive/cluster/delegation/
修改后重启 Metastore 和 HiveServer2。
2、清理膨胀的 ZooKeeper 令牌节点(根治关键)
在 ZooKeeper 中,删除这个异常膨胀的节点,并重新创建干净的空节点。
1. 以 hive 用户身份连接 ZooKeeper(需 Kerberos 认证)
zkCli.sh -server wf-gd2-bpit-dp-nn-17-70:2181
2. 查看该节点的数据大小(如果 ls 都失败,说明已无法读取)
ls /hive/cluster/delegationMETASTORE/tokens
3. 删除膨胀的节点
deleteall /hive/cluster/delegationMETASTORE/tokens
3、检查令牌过期与清理策略
委托令牌膨胀到 100+ MB,说明过期令牌没有被及时清理。检查以下配置:
hive.cluster.delegation.token.max-lifetime 604800 hive.cluster.delegation.token.renew-interval 86400 同时检查 Metastore 的后台清理线程是否正常运行。
修改为:
hive.cluster.delegation.token.max-lifetime 86400 hive.cluster.delegation.token.renew-interval 43200