How to enable Ranger Admin High Availability

It is useful to enable Ranger Admin High availability, since, it would help in having access to Policy Manager even if one of the Ranger Admin is down. This document provides steps to enable Ranger Admin HA [High Availability] using an example. To configure Ranger Admin HA, it is also required to configure Load Balancing in Linux.

2. Install HAProxy

3. Starting the HAProxy server:

# service haproxy start

4. To make the HAProxy service persist through reboots

# chkconfig haproxy on

5. To reload the Service post changes to haproxy.cfg

# service haproxy reload

​6. Configure haproxy.cfg in the Load Balancing Node haproxy.cfg should have the entries to resolve load balancer node to the Ranger Admin nodes. Consider for example the configurations in the Environment table above, the entries in /etc/haproxy/haproxy.cfg would be as follows:

Configuring Ranger Admin HA

1. Use Ambari Ranger-configs to update the Policy Manager external URL to point to the load balancer URL in the Ranger Settings. This would update all Ranger Admin clients (Ranger UserSync and Ranger plug-ins). For example,

2. Save the above and Restart Ranger services as suggested by Ambari.3. In Ambari Ranger Services, click on Service Actions and choose Enable Ranger Admin HA.4. In the Wizard provide the Load balancer external URL, for example, http://hn3.hwxblr.com:6080

5. Select additional Ranger Admin, for example hn2.hwxblr.com.

6. Proceed with Installation.

7. Once the installation completes, the two Ranger Admin’s would be displayed in Ambari Ranger-Server page and Service Action would have Enable Ranger Admin HA greyed out.

Test Ranger Admin HA

As per the configuration above, the load balancer would look up the two Ranger Admin nodes configured in a round robin fashion and resolve to the one which is alive.To test, bring down one of the two Ranger Admin nodes alternatively and invoke the Load Balancer URL, for example, bring down node hn1.hwxblr.com and attempt to view the Policy Manager Console using the Load balancer URL: http://hn3.hwxblr.com:6080