beeline连接数据库报错Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/cr: java.n

beeline> !connect jdbc:hive2://localhost:10000/cr
Connecting to jdbc:hive2://localhost:10000/cr
Enter username for jdbc:hive2://localhost:10000/cr:
Enter password for jdbc:hive2://localhost:10000/cr:
18/08/13 08:47:02 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/cr: java.net.ConnectException: Connection refused (state=08S01,code=0)

the best resolution is restart hiveserver2 service~~~~~~~

[xiaoqiu@s150 /tmp/xiaoqiu]$ netstat -anop|grep 10000
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        1      0 127.0.0.1:48303         127.0.0.1:10000         CLOSE_WAIT  7558/java            keepalive (2715.77/0/0)
[xiaoqiu@s150 /tmp/xiaoqiu]$ kill -9 7558
[xiaoqiu@s150 /tmp/xiaoqiu]$ netstat -anop|grep 10000
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
[xiaoqiu@s150 /tmp/xiaoqiu]$ hiveserver2

it works !!!!

你可能感兴趣的:(hive,Hive)