Support Questions

Find answers, ask questions, and share your expertise

How to Deregister Hiverserver2 from Zookeeper after a crash

avatar

HiveServer2 crashed and wasn't deregistered properly from Zookeeper.

Now anytime I try restarting HiveServer2, it starts in Ambari, shows green but immediately shutdowns.


screen-shot-2015-10-15-at-21140-pm.png
1 ACCEPTED SOLUTION

avatar

The HS2 instances register with ZooKeeper under a namespace. When a HiveServer2 instance comes up, it registers itself with ZooKeeper by adding a znode in Zookeeper. The znode name has the format:

/<hiveserver2_namespace>/serverUri=<host:port>;version=<versionInfo>; sequence=<sequence_number>

To de-register a single HiveServer2, enter

hive --service hiveserver2 --deregister <package ID>

You can find more information about HiverServer2 within Zookeeper on http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_hadoop-ha/content/ha-hs2-service-discover...

View solution in original post

5 REPLIES 5

avatar
Super Collaborator

Have you tried using zkCli.sh to browse the Zookeeper entries? I do not know the path for HS2 but you should be able to poke around and find it. Assuming you can find it, you should be able to delete the entry. I haven't tried this but I think that is how the entry is registered.

avatar

Here is what I did to solve this.

Doublecheck that

  1. hive.zookeeper.quorum is set to the ZooKeeper ensemble (a comma separated list of ZooKeeper server host:ports running at the cluster)
  2. Set hive.server2.support.dynamic.service.discovery to true
  3. Set hive.server2.zookeeper.namespace to the value that you want to use as the root namespace on ZooKeeper. The default value is hiveserver2.

Now for what solved this,

  • There was no hive.zookeeper.session.timeout setting. Customize hive.zookeeper.session.timeout so that it closes the connection between the HiveServer2’s client and ZooKeeper if a heartbeat is not received within the timeout period.
  • Add hive.zookeeper.session.timeout to 60000 in Ambari -> Hive -> Config -> Advanced -> Custom Hive site

screen-shot-2015-10-15-at-31727-pm.png

  • Restart Hive from Ambari.

See also

hive.zookeeper.session.timeout is set to null in hive-default.xml

avatar

The HS2 instances register with ZooKeeper under a namespace. When a HiveServer2 instance comes up, it registers itself with ZooKeeper by adding a znode in Zookeeper. The znode name has the format:

/<hiveserver2_namespace>/serverUri=<host:port>;version=<versionInfo>; sequence=<sequence_number>

To de-register a single HiveServer2, enter

hive --service hiveserver2 --deregister <package ID>

You can find more information about HiverServer2 within Zookeeper on http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_hadoop-ha/content/ha-hs2-service-discover...

avatar
hive --service hiveserver2 --deregister <Package ID>

How do I find the package id for the hiveserver2?

Thanks

Manish

avatar

Nevermind! Found a method to pull the hiveserver2 out of the zookeeper ensemble by deleting its znode using zookeeper client.

Here's the info from MapR's website.