Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Transparant Hiverserver2 transport modes with Zookeeper

avatar

According to this post you can't run Hiverserver2 in both binary & http mode, you need multiple clients for that. I want to be able to connect via zookeeper to Hiverserver2 either binary & http. How should one go about that?

1 ACCEPTED SOLUTION

avatar

If i understand your question, you want to connect to HiveServer2 using Zookeeper without having the client to worry about the transport mode. This is supported by the HiveServer2 feature - Zookeeper Service Discovery Mode. If you are using Ambari this is the default mode.

With introduction of HIVE-11581, the JDBC url becomes very simple as none of the additional configuration parameters such as authentication mode, transport mode, or SSL parameters need to be specified, as they are retrieved from the ZooKeeper entries along with the hostname.

JDBC URL: jdbc:hive2://<zookeeper quorum>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

The <zookeeper quorum> is the same as the value of hive.zookeeper.quorum configuration parameter in hive-site.xml/hivserver2-site.xml used by HiveServer2.

Read more about it here.

View solution in original post

4 REPLIES 4

avatar

If i understand your question, you want to connect to HiveServer2 using Zookeeper without having the client to worry about the transport mode. This is supported by the HiveServer2 feature - Zookeeper Service Discovery Mode. If you are using Ambari this is the default mode.

With introduction of HIVE-11581, the JDBC url becomes very simple as none of the additional configuration parameters such as authentication mode, transport mode, or SSL parameters need to be specified, as they are retrieved from the ZooKeeper entries along with the hostname.

JDBC URL: jdbc:hive2://<zookeeper quorum>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

The <zookeeper quorum> is the same as the value of hive.zookeeper.quorum configuration parameter in hive-site.xml/hivserver2-site.xml used by HiveServer2.

Read more about it here.

avatar

Thx Deepesh. When I explicitly want the client to use http transport mode ('transportMode=http'), does Zookeeper Service Discovery Mode support that?

avatar

HiveServer2 transport mode can be set to http, clients will be able to connect using either the Zookeeper Service Discovery mode or directly to the HS2 server.

avatar

Does that mean that zookeeper service discovery mode can not be used with a mixed HiveServer2 transport mode client setup?