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

Updating a Ranger Package

Updating a Ranger package for any reason requires re-enabling the Hive plugin and restarting Hive services:
  1. After each Ranger package update, run the following script:
    sudo bash /opt/mapr/ranger/ranger-<version>/ranger-hive-plugin/enable-hive-plugin.sh
  2. Restart Hive services:
    maprcli node services -name hivemeta -action restart -nodes `hostname -f`
    maprcli node services -name hs2 -action restart -nodes `hostname -f`

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.