Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HiveServer2 Binary and HTTP HA

Highlighted

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
Highlighted

Re: HiveServer2 Binary and HTTP HA

@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

Highlighted

Re: HiveServer2 Binary and HTTP HA

Contributor

Hi @Rajkumar Singh

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

Cheers,

Wendell

Highlighted

Re: HiveServer2 Binary and HTTP HA

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

Highlighted

Re: HiveServer2 Binary and HTTP HA

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>

Don't have an account?
Coming from Hortonworks? Activate your account here