Installing Ranger

This topic includes instructions for using package managers to download and install Ranger from the EEP repository.

To set up the EEP repository, see Step 11: Install Ecosystem Components Manually.

Prerequisites for Installing Ranger

Ranger requires a database to store its internal data. Ranger uses MySQL as its default internal database, but Ranger also supports Oracle, PostgreSQL, MSSQL, and SQLA. Before Ranger installation and configuration, you must ensure that one of the supported databases is ready for Ranger to use. Perform these steps:
IMPORTANT
You can also provide the root credentials later while configuring the ranger. If you choose to provide the root credentials later, skip the following Step 1. and 2. See Configuring Ranger details.
  1. Create a user for Ranger in the database. Note that the user name and password you specify in this step will be used for Ranger Admin configuration. The following example is for MySQL; the commands can be different for other databases:
    mysql -uroot -p<root_password> 
    
    CREATE USER 'ranger_user_name'@'localhost' IDENTIFIED BY 'ranger_user_password'; 
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'localhost' WITH GRANT OPTION; 
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'localhost' IDENTIFIED BY 'ranger_user_password' WITH GRANT OPTION; 
     
    CREATE USER 'ranger_user_name'@'%' IDENTIFIED BY 'ranger_user_password'; 
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'%' WITH GRANT OPTION; 
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'%' IDENTIFIED BY 'ranger_user_password' WITH GRANT OPTION; 
     
    CREATE USER 'ranger_user_name'@'FQDN' IDENTIFIED BY 'ranger_user_password'; 
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'FQDN' WITH GRANT OPTION;  
    GRANT ALL PRIVILEGES ON *.* TO 'ranger_user_name'@'FQDN' IDENTIFIED BY 'ranger_user_password' WITH GRANT OPTION; 
     
    FLUSH PRIVILEGES; 
  2. Ensure that the database for Ranger is created by its user. The database name that you specify in this step is used for Ranger Admin configuration:
    mysql -uranger_user_name -p ranger_user_password 
    create database rangerdb;
  3. For SLES installations only: Install the insserv-compat package before setting up Ranger services:
    sudo zypper install insserv-compat
    Ranger uses System V initialization scripts to create the runtime directory. Installing insserv-compat ensures that the installation is compatible with the initialization scripts.

Installing Ranger

On each planned Ranger node, install mapr-ranger. Run the following commands as the cluster admin (typically the mapr user):

Ubuntu
apt-get install mapr-ranger
RHEL
yum install mapr-ranger
SLES
zypper install mapr-ranger

Installing the Ranger Hive Plugin

You must install the Ranger Hive plugin only if you plan to restrict access to the HiveServer2 or Hive Metastore.

On each Hive node running HiveServer2 and Hive Metastore, if you are going to integrate Ranger with Hive Metastore, use the following command to install the mapr-ranger-hive-plugin:
Ubuntu
apt-get install mapr-ranger-hive-plugin
RHEL
yum install mapr-ranger-hive-plugin
SLES
zypper install mapr-ranger-hive-plugin

Installing the Ranger UserSync Service

The Ranger UserSync service is a helper service that obtains user information from Linux or LDAP and supplies the information to the Ranger Admin service. The Admin service leverages this information to create policies that apply to specific users of the platform.

You can choose to install the UserSync service on the same nodes where you install the Ranger Admin service, or you can install the service on nodes where the mapr-ranger package is not installed.

Run the following commands as the cluster admin (typically the mapr user):

Ubuntu
apt-get install mapr-ranger-usersync
RHEL
yum install mapr-ranger-usersync
SLES
zypper install mapr-ranger-usersync
NOTE
If you install mapr-ranger-usersync on a node where mapr-ranger is not installed, special configuration steps are required. See Configuring Ranger.

Removing a Ranger Package

Before removing a Ranger package, you must disable the Ranger Hive plugin:
sudo bash /opt/mapr/ranger/ranger-<version>/ranger-hive-plugin/disable-hive-plugin.sh

Post Installation Steps

To configure and start using Ranger, see Getting Started with Ranger.