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:

  1. Install Extra Packages for Enterprise Linux.

    $ sudo yum install epel-release -y
  2. Install Nginx.

    $ sudo yum install nginx -y
  3. 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.

  4. Launch Nginx.

    $ sudo systemctl enable nginx --now

    If 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:

  1. 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
    The "Add additional Ranger Admin" action
  2. 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) and ranger.admin.balancer.port (port, on which Nginx listens) parameters.

    Ranger HA parameters
    Ranger HA parameters
  3. Restart Ranger.

Check

To check if HA works, follow the steps below:

  1. Stop the Ranger Admin service on the primary host.

    $ sudo systemctl stop ranger-admin.service
  2. See if the Ranger Admin service is available on the Nginx host on the <port> port.

  3. Launch the service that was shut down.

    $ sudo systemctl start ranger-admin.service
  4. Complete the previous steps for each host with Ranger Admin installed.

  5. Separately check if the service is available on the Ranger Admin hosts.

Found a mistake? Seleсt text and press Ctrl+Enter to report it