googleads
Apache Ranger 0.7.1 Installation | Agira Technologies
preloder
DevOps Technical Web Development

Apache Ranger 0.7.1 Installation

Apache Ranger 0.7.1 is the current version of Apache Ranger. This blog will help you to Install Apache Ranger 0.7.1 on CentOS operating system. I have explained the entire process in simple and easy steps.

Prerequisites

The following components are required to process ranger installation.

  • JDK – For Running RangerAdmin, RangerKMS
  • RDBMS – Storing policies, Ranger Users, and Groups (MySQL/Oracle/Postgres/SQL Server)
  • Solr – Store Audit Logs (Apache Solr – 5.2.1+)
  • HDFS – Store Audit Logs 
  • Kerberos – Enabling Kerberos will ensure that the requests get authenticated.

Preparing to install

You need to log in as root or will need “sudo” access to install some of the build tools.

Step 1: Install Maven 3.3.9
 

Step 2: Install git
 

Step 3: Install gcc
 

Step 4: Install MySQL
 

 

  • To get the temp mysql password
 

 

  • Change default settings
 

 

  • Download the MySQL JDBC and place it into shared director
 

Build Ranger Admin from source

Add environment varialves in .bashrc

 

Clone ranger source code

 

Building the source

Run Maven to build ranger packages

 

After maven build succeeds, Verify all tar files under target directory

 

Sample output:

ranger-0.7.1-admin.tar.gz ranger-0.7.1-kms.tar.gz ranger-0.7.1-storm-plugin.tar.gz ranger-0.7.1-hbase-plugin.tar.gz ranger-0.7.1-knox-plugin.tar.gz ranger-0.7.1-usersync.tar.gz ranger-0.7.1-hdfs-plugin.tar.gz ranger-0.7.1-migration-util.tar.gz ranger-0.7.1-yarn-plugin.tar.gz ranger-0.7.1-hive-plugin.tar.gz ranger-0.7.1-solr-plugin.tar.gz ranger-0.7.1-kafka-plugin.tar.gz ranger-0.7.1-src.tar.gz

 

Install Solr

Audit logs are stored in Solr. (Note: if don’t want Solr, we can use DB to store the log https://community.hortonworks.com/questions/27957/does-ranger-05-work-without-solr.html) (we will try for store logs in HDFS)

 

Edit install.properties and add the following values,

 

Run setup script to install solr

 

Open /opt/solr/ranger_audit_server/install_notes.txt for instructions to start and stop Solr.

Check Solr by accessing http://${SOLR_HOST}:6083 from your browser.

Install Ranger Policy Admin

 

Configure Solr

  • Update install.properties
 

 

  • After updating the required properties, run setup.sh
 

 

  • Now th following command starts Ranger Admin
 

The ranger-admin script supports the following options,

  • Starting  Ranger Admin service: ranger-admin start
  • Stopping Ranger Admin service: ranger-admin stop
  • Restarting Ranger Admin service: ranger-admin restart

Verification can be done visiting the external URL of the server using browser, for instance

http://HOST_ADDRESS:6080 (Username: admin & PAssword: admin)

 

Configuring Ranger Admin Authentication Modes

  • Active Directory, LDAP and Unix are the authentication methods supported by Ranger Admin. 

UNIX

authentication_method = UNIX
remoteLoginEnabled = true
authServiceHostName = localhost
authentication_method = 5151

Installing the Ranger UserSync Process

  • Extract Ranger plugin build at /usr/local
 

 

  • Edit the install.properties file
 

 

  • Install usersync by running ./setup.sh command
 

 

  • After installing ranger ­usersync, Use start/stop services of usersync.
 

Apache Ranger HDFS Plugins

Step 1: Create new REPOSITORY_NAME service

If the REPOSITORY_NAME service doesn’t exist in Ranger Admin, the hdfs-plugin cannot communicate with it. So we have to make sure that it exists.

  • Go to http://HOST_ADDRESS:6080
  • Open Resource based policies link
  • Click ‘+’ under HDFS Grid to add new service
  • Update Service and Config Properties with the following

Service Name  : hadoopdev
Active Status : Enabled
Select Tag Service : HDFS (Service name created under Tag based policies)
Username : hadoop
Password : hadoop@123
Namenode URL : http://HOST_ADDRESS:50070

 

  • Leave all other field as defaults and save

Step 2: Install and configure HDFS Plugins

  • Extract Ranger plugin build at /usr/local
 

 

  • Edit the install.properties file
 

 

  • Enable hdfs­-plugin by running ./enable-hdfs-plugin.sh command
 

 

Ranger hdfs plugin installation might fail. To resolve this issue create a symlink as conf dir of hadoop linking to hadoop conf dir.

  • Add HADOOP_HOME env value into .bashrc file
 

  • Once the above changes are done run enable plugin script
 

 

Ranger Hive Plugin

Step 1: Create new REPOSITORY_NAME service

Make sure the REPOSITORY_NAME service exists in Ranger Admin. If not, the hive-plugin will not be able to communicate with Ranger admin

 

  • Go to http://HOST_ADDRESS:6080
  • Open Resource based policies link
  • Click + under HIVE Grid to add new service
  • Update following Service Details and Config Properties

Service Name  : hivedev
Active Status : Enabled
Select Tag Service : HIVE (Service name created under Tag based policies)
Username : hadoop
Password : hadoop@123
jdbc.driverClassName : org.apache.hive.jdbc.HiveDriver
jdbc.url : jdbc:hive2://sandbox:10000/

 

  • Leave all other field as default and save

Step 2: Install and configure HIVE Plugins

  • Extract Ranger plugin build at /usr/local
 

 

  • Edit the install.properties file
 

 

  • Create log directory
 

 

  • Enable hive-plugin by running enable-hive-plugin.sh command
 

That’s all now the latest version of Apache Ranger is installed in your system. Please comment below if you have any queries regarding the installation process. To read more on web development follow Agiratechnologies.

 

The following two tabs change content below.

Saravana

An enthusiastic Tech Lead with 7 plus years of experience in Web development arena. Owns legitimate experience in Ruby, Ruby On Rails, AngularJs, DevOps. Golang, Another add on, This young tech freak never miss a chance to get his hands on planting and Gardening even in his busy weekends.

One thought on “Apache Ranger 0.7.1 Installation”

Leave a Reply

Your email address will not be published. Required fields are marked *

[contact-form-7 id="120788" title="Web Page Form"]

Schedule Your Call