beeline 连接远端hive报错 Error: Could not open client transport with JDBC

求助:
beeline 连接远端hive报错 Error: Could not open client transport with JDBC

beeline> !connect jdbc:hive2://IP地址:10000/default
Connecting to jdbc:hive2://IP地址:10000/default
Enter username for jdbc:hive2://IP地址:10000/default: 用戶名
Enter password for jdbc:hive2://IP地址:10000/default: 密碼
20/08/06 10:50:33 [main]: WARN jdbc.HiveConnection: Failed to connect to IP地址:10000:10000
Unexpected end of file when reading from HS2 server. The root cause might be too many concurrent connections. Please ask the administrator to check the number of active connections, and adjust hive.server2.thrift.max.worker.threads if applicable.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://IP地址:10000/default: null (state=08S01,code=0)

我检查的几个点:
1.检查hiveserver2是否启动
$ sudo netstat -anp |grep 10000
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 17751/java

2.hadoop中的core-site.xml文件

<property>
<name>hadoop.proxyuser.用户名.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.用户名.users</name>
<value>*</value>
</property>

检查的这两个点自己觉得都没有问题,不知道问题出在哪里了,求助

解决的思路:

1.从hive.log中看到找不到jar中的函数CustomPasswdAuthenticator
猜测是不是少了一个包还是版本不对,从下面这个blog猜测可能要自己去写jar包。

hive-site.xml中增加登录的账密信息

模板:
<property>
    <name>hive.jdbc_passwd.auth.账号名称</name>
    <value>账号密码</value>
    <description/>
</property>

示例:
<property>
    <name>hive.jdbc_passwd.auth.zhagnsan</name>
    <value>123456789</value>
    <description/>
</property>


最终参考这个文章解决了。
https://blog.csdn.net/lr131425/article/details/72460489?utm_source=blogxgwz1

https://blog.csdn.net/xiaoqiu_cr/article/details/81634434