Configure Ranger Admin HA
High availability (HA) allows the Ranger Admin service to deploy a backup in case the main host goes down. In order to support HA for Ranger Admin, you can add an Nginx load balancer.
Nginx configuration
|
IMPORTANT
Nginx should be installed on a cluster host that doesn’t have the Ranger User synchronizer component on it.
|
On a dedicated Nginx host, do the following:
-
Install Extra Packages for Enterprise Linux.
$ sudo yum install epel-release -y -
Install Nginx.
$ sudo yum install nginx -y -
Add the following lines to the empty /etc/nginx/conf.d/ranger.conf file.
upstream ranger { server <ranger_admin_1>:6080; server <ranger_admin_2>:6080 backup; } server { listen <port>; location / { proxy_pass http://ranger; } }where:
-
<ranger_admin_1>and<ranger_admin_2>are the hosts with the Ranger Admin component installed. -
<port>is a free port, on which Nginx should listen.
-
-
Launch Nginx.
$ sudo systemctl enable nginx --nowIf everything is correct, the output should be similar to:
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
Configuration in ADCM
To configure HA for Ranger Admin, follow the steps below:
-
Add an extra Ranger Admin component if you haven’t already. The action will open the host-component mapping screen, on which you can add another host. This step should be completed before kerberization.
The "Add additional Ranger Admin" action -
In the Ranger service configuration, switch on the Show advanced flag, open the ranger-admin-site.xml parameter group, and fill the
ranger.admin.balancer.host(Nginx host URL) andranger.admin.balancer.port(port, on which Nginx listens) parameters.
Ranger HA parameters -
Restart Ranger.
Check
To check if HA works, follow the steps below:
-
Stop the Ranger Admin service on the primary host.
$ sudo systemctl stop ranger-admin.service -
See if the Ranger Admin service is available on the Nginx host on the
<port>port. -
Launch the service that was shut down.
$ sudo systemctl start ranger-admin.service -
Complete the previous steps for each host with Ranger Admin installed.
-
Separately check if the service is available on the Ranger Admin hosts.