Skip to main content
hlcastro
Bronze ⭐️⭐️⭐️
Jun 28, 2018 2:40 PM UTC
Solved

How to Fix ZooKeeperHiveClientException: Unable to Read HiveServer2 Configs from ZooKeeper

Caused by: java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read HiveServer2 configs from ZooKeeper at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:134) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.apache.ambari.view.hive20.internal.HiveConnectionWrapper$1.run(HiveConnectionWrapper.java:78) at org.apache.ambari.view.hive20.internal.HiveConnectionWrapper$1.run(HiveConnectionWrapper.java:75) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1869) at org.apache.ambari.view.hive20.internal.HiveConnectionWrapper.connect(HiveConnectionWrapper.java:75) ... 98 more Caused by: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read HiveServer2 configs from ZooKeeper at org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:96) at org.apache.hive.jdbc.Utils.configureConnParams(Utils.java:514) at org.apache.hive.jdbc.Utils.parseURL(Utils.java:434) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:132) ... 107 more Caused by: org.apache.hive.jdbc.ZooKeeperHiveClientException: Tried all existing HiveServer2 uris from ZooKeeper. at org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:68) ... 110 more

vmurakami
vmurakamiAnswer
Gold ⭐️
Jun 28, 2018 11:28 PM UTC

Hi @Hamilton Castro!
Could you check your ZK namespace under the hiveserver2 path?
Would be like this:

[root@node3 ~]# zookeeper-client
Connecting to localhost:2181
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /hiveserver2
[serverUri=node3:10000;version=1.2.1000.2.6.5.0-292;sequence=0000000013]

btw, if your zk hosts it's not under the hosts as HS2, check if HS2 can reach 2181 port from ZK host
Hope this helps!

7 replies

vmurakami
vmurakamiAnswer
Gold ⭐️
Jun 28, 2018 11:28 PM UTC

Hi @Hamilton Castro!
Could you check your ZK namespace under the hiveserver2 path?
Would be like this:

[root@node3 ~]# zookeeper-client
Connecting to localhost:2181
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /hiveserver2
[serverUri=node3:10000;version=1.2.1000.2.6.5.0-292;sequence=0000000013]

btw, if your zk hosts it's not under the hosts as HS2, check if HS2 can reach 2181 port from ZK host
Hope this helps!
Translate
marko_curlin
Silver ⭐️
Dec 14, 2018 11:28 PM UTC

I have the same output as you do : [serverUri=sandbox-hdp.hortonworks.com:10000;version=3.1.0.3.0.1.0-187;sequence=0000000008]

But I still get the following output when I try to start the sample.sh script that comes with Kylin:

[main]: ERROR jdbc.Utils: Unable to read HiveServer2 configs from ZooKeeper

Translate
oz6911
Silver ⭐️
Aug 10, 2018 2:18 AM UTC

Did you find the solution. I have the same error.

Translate
sidatbigdata
Gold ⭐️
Nov 20, 2018 5:32 PM UTC

hive namespace was not created in zookeeper but ui work sometime and sometime not. I changed the namespace,restarted the hive service and it started working.

Translate
debananda_sahoo
Silver ⭐️⭐️⭐️
Dec 21, 2018 9:37 PM UTC
@Sidharth Kumar

How you resolved this ? Can you share the exact steps or command.

In my case is showing like below.

hive.server2.zookeeper.namespace=hiveserver2

hive.zookeeper.namespace=hive_zookeeper_namespace

Translate
vinish
Silver ⭐️
Dec 28, 2019 8:09 PM UTC

1. Stop Hive service.

2. Delete hive service followed by its dependencies.
3. Restart HDFS, YARN, ZOOKEEPER.

4. Install HIVE, refresh hive client config on every host.

5. Start Hive service.

 

Check logs in back-end, some times you could see permission denied to remove "/var/lib/spark2/shs_db/listing.ldb", just remove it manually and restart the service.

Translate