Command Line Upgrade
Also available as:
PDF
loading table of contents...

Configure and Start Apache Ranger

This section describes how to upgrade the Apache Ranger service.

[Note]Note

XA Secure was an add-on component in HDP-2.1. Ranger is the new name for XA Secure. In HDP-2.2 and subsequent releases, Ranger is installed with HDP.

Preparing Your Cluster to Upgrade Ranger

If you are not currently using Ambari to manage your Hadoop cluster, you need to upgrade Ranger manually to the latest version. This section describes the steps you need to follow to prepare your cluster for the Ranger upgrade.

  1. Back up the following Ranger configuration directories:

    • Ranger Policy Administration Service

      /usr/lib/xapolicymgr
    • Ranger UserSync

      /usr/lib/uxugsync or /etc/uxugsync (Depending on your installation)
    • Ranger Plugins:

      • Hadoop

        /etc/hadoop/conf
      • Hive

        /etc/hive/conf
      • HBase

        /etc/hbase/conf
      • Knox

        /etc/knox/conf
      • Storm

        /etc/storm/conf
  2. Backup the Ranger Policy and Audit databases. Make sure to take note of the following details in the install.properties file:

    • db_host

    • db_name

    • db_user

    • db_password

    • policy manager configuration

    • LDAP directory configuration

    • LDAP settings

    • LDAP AD domain

    • LDAP URL

Stop the Ranger Services

Now that you have prepared your cluster for the Ranger upgrade, you need to stop the Ranger Admin and Ranger UserSync services. To stop the Ranger services, perform the steps described below.

  1. Stop the Ranger Policy Admin service. When the service is stopped, you receive an acknowledgement from the server that the service has been stopped.

    service xapolicymgr stop
  2. Stop the Ranger UserSync service. When the service is stopped, you receive an acknowledgement from the server that the service has been stopped.

    service uxugsync stop
  3. Stop each individual Ranger plugin (HDFS, HBase, Knox, Storm). You receive an acknowledgement from the server that the plugin has been stopped.

    service <plugin name> stop

Install the Ranger Components

Next, you need to re-install each Ranger component again to ensure you have the latest version. Because you have already upgraded your HDP stack, you only need to follow the instructions in the Non-Ambari Cluster Installation Guide to install each Ranger component. The following components must be installed:

  • Ranger Policy Admin service

  • Ranger UserSync service

  • Ranger Plugins:

    • HDFS

    • HBase

    • Hive

    • Knox

    • Storm

With this release, Ranger has also added support for the following components:

  • Solr

  • Kafka

  • YARN

Restart the Ranger Services

Once you have re-installed each Ranger component, you then need to restart these components to ensure the new configurations are loaded in your cluster. The Non-Ambari Cluster Installation Guide describes how you can start the following Ranger services:

  • Ranger Policy Admin service

    service ranger-admin start
  • Ranger UserSync service

    service ranger-usersync start

Remove Existing Startup Files and Symbolic Links

In order to ensure that your Ranger components are upgraded correctly, and there are no conflicts between versions, you should remove any existing startup files and symbolic links from the previous Ranger 2.2 version. The steps you need to follow to remove these files and links are described below.

  1. Remove the Policy Manager startup files.

    rm -f /etc/init.d/xapolicymgr
  2. Remove the Policy Manager symbolic links.

    rm -rf /etc/rc*.d/*xapolicymgr
  3. Remove the UserSync startup files.

    rm -f /etc/rc*.d/*uxugsync
  4. Remove the UserSync symbolic links.

    rm -rf /etc/rc*.d/uxugsync
  5. Remove the Policy Manager library files.

    rm -f /usr/lib/xapolicymgr
  6. Remove the UserSync library files.

    rm -f /usr/lib/uxugsync

Enable Ranger Plugins

The final step in the Ranger upgrade process requires you to re-enable the Ranger plugins. Although you are only required to enable HDFS in your cluster, you should re-enable all of the Ranger plugins because class names have changed for the 2.5.3 release.

[Note]Note

When you enable each Ranger plugin, make sure you remove all 2.1 class name values.

To re-enable the Ranger plugins, use the links listed below to access instructions in the Non-Ambari Cluster Installation guide that describe editing the install.properties file and enabling the Ranger plugins:

[Important]Important

Before enabling the HDFS plugin, remove set-hdfs-plugin-env.sh from /etc/hadoop/conf. You need to re-enable this plugin after the upgrade is complete.