Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to Configure Ranger Repository with Multiple HiveServer2 Instances

avatar

Hi,

How do you configure a Ranger Hive repository if you have two instances of HiveServer2 running in a cluster?

I'm assuming you don't create a separate repository for each one, so which jdbc URL do you provide to the repository configs? Do you perhaps have to have Zookeeper discovery enabled and then use that URL? What happens if you don't want to use the multiple HS2 instances in a failover kind of structure, but rather have them as two separate processes running at the same time? Is such a thing supported?

Thanks in advance,

Ana

EDIT: This post here has a great explanation of different JDBC URLs for ZK discovery: http://community.hortonworks.com/questions/1342/how-to-enable-zookeeper-discovery-for-hiveserver2.ht...

1 ACCEPTED SOLUTION

avatar

You can change the JDBC URL to something like below.

jdbc:hive2://<host1:2181,host2:2181>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

View solution in original post

5 REPLIES 5

avatar

You can change the JDBC URL to something like below.

jdbc:hive2://<host1:2181,host2:2181>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

avatar

That's what i figured if they set up ZK discovery - so you're saying you do have to have ZK discovery set up? There's no other way?

avatar
Rising Star

JDBC URL specified in Ranger Hive repository configuration is used to provide lookup lists as the users enter database/table/column names in Ranger policy UI. In this scenario, Ranger admin acts as a Hive client to retrieve the names from HiveServer2. The JDBC URL specified should be the same as that of any other client talking to HiveServer2.

How do the users access these HiveServer2 instances, if not by ZK discovery?

avatar

Note that when running more that one Hiveserver2 instances registered on zookeeper you also get load balancing when client uses the ZK info in JDBC url. ZooKeeper responds to client requests by randomly passing a link to one of the active HS2 instances.

avatar

Ah! Ok, I had misunderstood that part of the HS2 HA. Thanks for clarifying!