Support Questions
Find answers, ask questions, and share your expertise

HiveServer2 Binary and HTTP HA

Contributor

Hi,

I know we can setup 2 HiveServer2 instances with different protocol, binary and http, for different clients. But how to enable HA in this scenario? My plan is to setup 4 HiveServer2 instances, 2 with binary and HA each other, another 2 with http HA each other. Not sure is it possible, and how to setup this?

Cheers,

Wendell

4 REPLIES 4

@wbu

looking at the source code

https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L1...

https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L1...

if you register 4 hiveserver2 instances (2 with binary while 2 with http mode) client can connect to any of this one hiveserver2 running with any protocol. so its not a HA between two similar protocol

Contributor

Hi @Rajkumar Singh

Then have to use load balancer for the HA of same protocol?

Cheers,

Wendell

@wbu no, to achieve HA on the same protocol, you need to register similar protocol hiveserver2 with zookeeper.

Master Collaborator

As you mentioned that you want 4 instances of HS2, 2 in binary HA and 2 in http HA, you can can acheive that by registering similar transport protocols with the same zookeeper namespace. So, in case of the two binary HA instances, you can define the configs like this

hive.server2.zookeeper.namespace=hiveserver2-binary

and for the other two http HA instances

hive.server2.zookeeper.namespace=hiveserver2-http

Then in the connection URL JDBC clients would provide the appropriate zkNamespace

jdbc:hive2://$ZK_URL/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-<protocol>

; ;