Rolling Upgrade for HiveServer2 Through ZooKeeper
There are additional configuration settings and procedures that need to be implemented to support rolling upgrade for HiveServer.
Configuration Requirements
Set h
ive.zookeeper.quorum
to the ZooKeeper ensemble (a comma separated list of ZooKeeper server host:ports running at the cluster)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.Set
hive.server2.support.dynamic.service.discovery
to trueSet
hive.server2.zookeeper.namespace
to the value that you want to use as the root namespace on ZooKeeper. The default value is hiveserver2.The adminstrator should ensure that the ZooKeeper service is running on the cluster, and that each HiveServer2 instance gets a unique host:port combination to bind to upon startup.
Upgrade Steps
Without altering the old version of HiveServer2, bring up instances of the new version of HiveServer2. Make sure they start up successfully.
To de-register instances of the old version of HiveServer2, enter
hive service hiveserver2 deregister
Do not shut down the older instances of HiveServer2, as they might have active client sessions. When sessions complete and the last client connection is closed, the server instances shut down on their own. Eventually all instances of the older version of HiveServer2 will become inactive.
Downgrade (Rollback) Steps
Bring up instances of the older version of HiveServer2. Make sure they start up successfully.
To explicitly de-register the instances of the newer version of HiveServer2, enter:
hive service hiveserver2 deregister
Do not shut down the newer instances of HiveServer2, as they might have active client sessions. When sessions complete and the last client connection is closed, the server instances shut down on their own. Eventually all instances of the newer version of HiveServer2 will become inactive.