Monday, June 13, 2016

Beeline HS2 High Availablity Using Zookeeper

Add  Below property in HS2 node and restart the service.
<property>
        <name>hive.server2.support.dynamic.service.discovery</name>
        <value>true</value>
</property>
<property>
        <name>hive.zookeeper.quorum</name>
        <value>node1:5181,node2:5181,node3:5181,node4:5181,node5:5181</value>
</property>
<property>
        <name>hive.server2.zookeeper.namespace</name>
        <value>hiveserver2</value>
</property>

Connecting Hive Via Beeline:

#beeline -u jdbc:hive2://node1:5181,node2:5181,node3:5181,node4:5181,node5:5181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 -n username -p password
scan complete in 3ms
Connecting to jdbc:hive2://node1:5181,node2:5181,node3:5181,node4:5181,node5:5181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
Connected to: Apache Hive (version 0.13.0-mapr-1504)
Driver: Hive JDBC (version 0.13.0-mapr-1504)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 0.13.0-mapr-1504 by Apache Hive
0: jdbc:hive2://node1:5181,node2:5181,node3:5181,node4:5181,node5:5181> show tables;
+--------------------------------------+
|               tab_name               |
+--------------------------------------+

No comments:

Post a Comment