Integrating HiveServer2 with Ranger
Describes how to integrate HiveServer2 with Ranger.
Use these steps:
- Ensure that the
mapr-ranger-hive-plugin
is installed, as described in Installing Ranger. If HiveServer2 is installed in HA mode, you must ensure that themapr-ranger-hive-plugin
is installed on both nodes for which HA is enabled. - Open the Ranger Admin UI using the
secure address:
- Secure address:
https://<FQDN>:6182
- Secure address:
- In the Service Manager screen, create a Hive (Hadoop SQL)
service by providing the following properties:
Properties Type Property Specify . . . Main Properties Service Name
Any name for the service Username
<cluster-admin>
Password
<cluster-admin-password>
Jdbc.driverClassName
org.apache.hive.jdbc.HiveDriver
Jdbc.url
jdbc:hive2://FQDN:10000/;ssl=true
policy.download.auth.users
Cluster admin or component's main user - Test the connection between Ranger and Hive:
- Modify the following properties in the
install.properties
in the Ranger Hive plug-in home directory (/opt/mapr/ranger/ranger-<version>/ranger-hive-plugin/install.properties
):IMPORTANTTheREPOSITORY_NAME
must be the same as theService Name
you specified in step 3, or the plug-in will not work.POLICY_MGR_URL=http(s)://FQDN:<ranger-admin-port> REPOSITORY_NAME=hivedev COMPONENT_INSTALL_DIR_NAME=/opt/mapr/hive/hive-3.1.3
- Enable the
plug-in:
sudo /opt/mapr/ranger/ranger-<version>/ranger-hive-plugin/enable-hive-plugin.sh
- Restart Hive
services:
maprcli node services -name hs2 -action restart -nodes `hostname` maprcli node services -name hivemeta -action restart -nodes `hostname` maprcli node services -name hcat -action restart -nodes `hostname`
- To verify that the plug-in is active, navigate to Audit > Plugin Status: