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.

How to Configure Ranger Repository with Multiple HiveServer2 Instances

Solved Go to solution
Highlighted

How to Configure Ranger Repository with Multiple HiveServer2 Instances

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

Accepted Solutions
Highlighted

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

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
Highlighted

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

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

Highlighted

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

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?

Highlighted

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

Contributor

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?

Highlighted

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

Master Collaborator

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.

Re: How to Configure Ranger Repository with Multiple HiveServer2 Instances

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

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