Support Questions

Find answers, ask questions, and share your expertise

Hive connectivity issues. Tried all suggestions given in the forums

New Contributor

1)[root@sandbox ~]# beeline -u 'jdbc:hive2://;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2'

18/03/01 00:47:35 [main-SendThread(]: WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect Connection refused

2)beeline> !connect jdbc:hive2://

Connecting to jdbc:hive2://

Enter username for jdbc:hive2:// root

Enter password for jdbc:hive2:// **********

Error: Could not open client transport with JDBC Uri: jdbc:hive2:// Connection refused (Connection refused) (state=08S01,code=0)

Additionally, I am not able to start ambari at url: or <corresponding ip address>:8080

These properties are set in hive-site.xml


<property> <name>hive.server2.zookeeper.namespace</name> <value>hiveserver2</value> </property>

<property> <name></name> <value>true</value> </property>



@Kumar K,

Looks like your hiveserver2 is not running. Please start hiveserver2 and then run the beeline command.

To start HiveServer2, Go to Ambari -> Hive -> Click on HiveServer2 -> Start

Also , can you please run the command and paste the output here

netstat -tupln | grep 10000



Rising Star
@Bharath Kumar K
Looks like your ambari-server is not running. Can you login to ambari master node and run below command -

ambari-server status

If it is not running, please start ambari server. Also, check status for all ambari agents.

New Contributor

Thank you so much for taking time to look into it.

My ambari portal is not working.

[root@sandbox ~]# ambari-server status

Using python /usr/bin/python2

Ambari-server status

Ambari Server not running. Stale PID File at: /var/run/ambari-server/

hence I started it manually

[root@sandbox ~]# ambari-star./

-bash: ambari-star./ No such file or directory

[root@sandbox ~]# ./

Starting Ambari...

Starting Ambari server [ OK ]

Starting Ambari agent [ OK ]


Ambari autostart enabled

To disable auto-start of Ambari do

# chkconfig ambari off


I am still no table to access Ambari at or

Didn't get any output for both these commands.

[root@sandbox ~]# netstat -tupln | grep 8080

[root@sandbox ~]# netstat -tupln | grep 10000

so followed the instructions to manually start hive-server2 in (

[root@sandbox ~]# beeline -u jdbc:hive2://

Connecting to jdbc:hive2://

Connected to: Apache Hive (version 1.2.1000.

Driver: Hive JDBC (version 1.2.1000.


Beeline version 1.2.1000. by Apache Hive

jdbc:hive2://> show databases;

| database_name |


| default |

Now the issue is if I use below jdbc connection with discovery mode zookeeper, I am getting error.

beeline -u 'jdbc:hive2://;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2'

Connecting to jdbc:hive2://;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

18/03/07 00:54:45 [main-SendThread(]: WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect Connection refused

Manually started zk.

[root@sandbox ~]# /usr/hdp/ start

ZooKeeper JMX enabled by default

Using config: /usr/hdp/

Starting zookeeper ... STARTED

But still no luck.

Something is terribly wrong with some configuration as both zookeeper and ambari had issues. Earlier I used a different version of sandbox(2 years back) and didn't receive so many issues.

Current sandbox is HDP 2.4

Could you pls suggest.


Hello, could you please use 2.6 Sandbox? It is more robust & running with lot of enhancements throughout the stack. If there is no business restriction, please use the latest HDP 2.6.x Sandbox. Thanks.