Apache Ranger™ and Ranger KMS
This manual is an installation guide for Apache Ranger™ and Ranger KMS.
This procedure applies to the GHDP environment.
Prerequisites
Install the prerequisites for the Ranger build.
Maven
Download the latest version of Maven at Downloading Apache Maven or:
cd /usr/local wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz tar -xvf apache-maven-<Version>-bin.tar.gzEdit the file that loads the GHDP environment variables:
vim /etc/profile.d/hadoop_setup.sh... # MAVEN (to Ranger) export M2_VERSION=$(ls -A /usr/local/ | grep apache-maven- | grep -v .gz | awk -F '-' '{print $3}') export M2_HOME=/usr/local/apache-maven-$M2_VERSION export M2=$M2_HOME/bin ...Verify that the installation was successful:
mvn -version
Other requirements
Install the other required items:
Ranger Build
Download the source of the most up-to-date Ranger that suits your OS and Java version, from the official Ranger site or:
Run the build of Ranger using Maven:
If an insecure access error occurs due to an expired certificate on some repository link, run the build as follows:
Finish the build procedure with the following command:
At the end, a folder called
targetwith all Ranger components will be generated.
Solr Installation
Refer to the Official Solr Site for the best Solr version for your system.
Go to the build Ranger previous topic.
Inside that folder, go to the Solr installer folder, where it will be pre-configured for Ranger use:
Create the Solr folder according to the chosen version:
Edit the file
install.properties:Run the script
setup.shand check the start procedures as indicated by the installation log:Start Solr:
Ranger Admin installation and configuration
Create the Ranger Admin folder:
Go to the folder
targetgenerated in the buildprocedure, and unzip the fileranger-2.3.0-admin.tar.gz:Copy all files inside the unzipped folder to the
ranger-admin.In the database, create the user
rangerdbaas follows:If not installed, install the
mysql-connector-javaand verify that the filemysql-connector-java.jaris in the correct folder:Create the logs folder for Ranger Admin:
In the Ranger Admin folder, edit the file
install.properties:Run the setup:
Add permissions for the Ranger folders and logs and add the user
rangerto the grouphadoop.To start Ranger Admin use the command:
Access the link and enter the user
adminand the pre-configured password.
In this context, the pre-configured password will always be Griaule.123.
Ranger UserSync Installation
In the Ranger build folder, create a folder for Ranger UserSync called
ranger-usersyncand unzip thetar.gzrelated to the application and copy all files to the created folder:Create the logs and grant the user
rangeraccess to the folders/usr/gdp/hadoop/ranger/and/var/log/hadoop/ranger/:In the
ranger-usersyncfolder, edit the fileinstall.propertiesas follows:Change the path default of the application from
/etc/rangeraddress to/usr/gdp/hadoop/ranger/2.3.0/ranger-usersync/ranger:Run the script
setup.sh:Change the configuration to enable UserSync synchronization:
After the installation with result successfully, start the service using the script
ranger-usersync-services.sh:
Plugin Installation
The plugins are not required for the operation of Ranger KMS. They are only features available for auditing Hadoop resources.
HDFS Plugin
The HDFS Plugin must be installed on all the NameNodes.
Create the folder
ranger-hdfs-pluginaccording to the GHDP structure:In the Ranger build of Ranger, unzip the file
ranger-2.3.0-hdfs-plugin.tar.gzand copy all files to the folder created previously:In the plugin folder, edit the file
install.properties:If there is more than one NameNode, create the same folder structure and copy all content to the other NameNodes with
scp:This procedure must be performed before enabling the plugin.
Enable the plugin running the script
enable-hdfs-plugin.sh:Connect to the Ranger Admin UI. On the main screen, under HDFS, click the + button and fill the fields with the following information:
Service Name:
hadoopdevDisplay Name:
hadoopdevUsername:
hadoop(UNIX User)Password:
<password created for the hadoop user on UNIX>NameNode URL:
hdfs://localhost:50070Authentication Type:
Simple
Keep the rest of the settings unchanged and click the Add button.
Restart the cluster.
HBase Plugin
The HBase Plugin must be installed on all hosts with Master and Regional.
Create the folder
ranger-hbase-pluginaccording to the GHDP structure.In the Ranger build of Ranger, unzip the file
ranger-2.3.0-hbase-plugin.tar.gzand copy all files to the folder created previously:In the plugin folder, edit the file
install.properties:Create the same folder structure and copy all content to the Master and Regional:
This procedure must be performed before enabling the plugin.
Create a user
hbaseand enable the plugin running the scriptenable-hbase-plugin.sh:Connect to the Ranger Admin UI. On the main screen, under HDFS, click the + button and fill the fields with the following information:
Service Name:
hadoopdevDisplay Name:
hadoopdevUsername:
hbase(UNIX User)Password:
<password created for the hbase user on UNIX>hadoop.security.authentication:
Simplehbase.security.authentication:
Simplehbase.zookeeper.property.clientPort:
2181hbase.zookeeper.quorum:
,,zookeeper.znode.parent:
/hbase-unsecure
Keep the rest of the settings unchanged and click the Add button.
Restart the cluster.
Kafka Plugin
The Kafka Plugin must be installed on all hosts that have the component installed.
Create the folder
ranger-kafka-pluginaccording to the GHDP structure:In the Ranger build of Ranger, unzip the file
ranger-2.3.0-kafka-plugin.tar.gzand copy all files to the folder created previously:In the plugin folder, edit the file
install.properties:Create the same folder structure and copy all content to the other nodes:
This procedure must be performed before enabling the plugin.
Create a user
kafkaand enable the plugin running the scriptenable-kafka-plugin.sh:Connect to the Ranger Admin UI. On the main screen, under HDFS, click the + button and fill the fields with the following information:
Service Name:
hadoopdevDisplay Name:
hadoopdevUsername:
hbase(UNIX User)Password:
<password created for the hbase user on UNIX>hadoop.security.authentication:
Simplehbase.security.authentication:
Simplehbase.zookeeper.property.clientPort:
2181hbase.zookeeper.quorum:
,,zookeeper.znode.parent:
/hbase-unsecure
Keep the rest of the settings unchanged and click the Add button.
Restart the cluster.
Ranger KMS Installation and Configuration
Ranger KMS Installation
Create the folder
ranger-kmsaccording to the GHDP structure:On the MySQL server, create a user
rangerkmsfor database management by the application:In the Ranger build of Ranger, unzip Ranger KMS and copy all files to the folder created previously:
Create the logs for Ranger KMS:
Using a password generator, create a password with the following parameters and store it in a safe place (it will be used in the next step):
16 characters
Uppercase letters
Lowercase letters
Special characters.
In the Ranger KMS folder, edit the file
install.propertiesadding configuration for Java Key Store (stores the master key in a file on the server itself):Use the 16-character password generated in the previous step as
KMS_MASTER_KEY_PASSWD. For example:$ZH1$Q8&ExUaTku8.
Ranger KMS Configuration with Luna Cloud HSM
Before performing the setup of Ranger KMS, it is necessary to add the LunaProvider in the
java.security. To do this, edit the filejava.security, which is located in the folder<JDK_installation_directory>/jre/lib/security, adding two lines at the end: one with the LunaProvider in the provider list sequence,security.provider.10=com.safenetinc.luna.provider.LunaProvider, and one with the setting for Luna to work,com.safenetinc.luna.provider.createExtractableKeys=true:Copy the files
LunaProvider.jarandlibLunaAPI.soto the folder<JDK_installation_directory/jre/lib/ext.Using a password generator, create a password with the following parameters and store it in a safe place (it will be used in the next step):
16 characters
Uppercase letters
Lowercase letters
Special characters.
Edit the file
install.propertiesto the setup of Ranger KMS with Luna Cloud HSM:Use the 16-character password generated in the previous step as
KMS_MASTER_KEY_PASSWD. For example:$ZH1$Q8&ExUaTku8.In all the nodes, so that the datanodes can access the KMS, edit the file
core-site.xmlchanging the value of the propertyhadoop.security.key.provider.pathaddress tokms://http@localhost:9292/kms:Restart HDFS.
Grant the user
kmspermissions for the folders:Run the script of setup, wait for the installation to finish with the message successfully and start Ranger KMS:
If everything went successfully, it will be possible to access the Ranger KMS dashboard through the Ranger Admin address using the user
keyadminand the password defined in the Ranger Admin installation procedure.Link:
http://<my_ip>:6080/User:
keyadminPassword:
<defined in install.properties during Ranger Admin setup>
Log into the Ranger Admin UI with the user
admin, go to Settings > Users/Groups/Roles. On the Users tab, click the Add New User button and create the users:hivehdfsomhbase
Then, log out and log in as
keyadminto access the Ranger KMS UI dashboard in the KMS Service. Click the + button to create the repositorykmsdev, according to the specifications below:Service Name:
kmsdevKMS URL:
kms://http@:9292/kmsUsername:
keyadminPassword:
<password set in the Ranger Admin installation procedure>
On the same screen, in Audit Filter, click the + button to add an ACL with the following specifications:
Access Result:
ALLOWEDPermissions:
Select AllUsers:
keyadmin
Click Add. Then, click to edit the repository
kmsdevand click the Test Connection button to confirm if the entire procedure ran correctly.Restart Ranger KMS:
If you are using Luna Cloud HSM, verify whether the master keywas created. To do this, run the
lunacm:Or:
Log in with the role crypto officer:
List the partition contents to check if the master key was created successfully:
Example output with the master key created:
The Ranger KMS configuration file, dbks-site.xml, is located at:
Enable Load Balancer in Ranger KMS
On a second server, perform the entire Ranger KMS installation.
If you are using Luna Cloud HSM, follow the instructions in the Luna Cloud HSM installation guide contained in the topics 1.1. Client download and 1.2. Client installation on the server to perform the client installation. It is not necessary to perform the procedures to activate slot, start partition, or start the roles contained in later topics of the guide. Then, strictly follow the instructions for installation and configuration of the HSM with Ranger, but taking the precautions described below.
On the step 5 of the configuration, in which it is necessary to change the file
core-site.xmlso that the datanodes can access the KMS, proceed as follows: open the file, find the propertyhadoop.security.key.provider.pathand change its value ofkms://http@localhost:9292/kmsaddress tokms://http@host1;host2:9292/kms:Before:
After:
Restart HDFS:
Continue with the completion of the Ranger KMS configuration, starting from step 6.
Ranger Uninstallation
To uninstall Ranger, run the following commands:
Last updated
Was this helpful?

