Integrating HiveServer2 with Ranger
Describes how to integrate HiveServer2 with Ranger.
Use these steps:
- Ensure that the
mapr-ranger-hive-pluginis installed, as described in Installing Ranger. If HiveServer2 is installed in HA mode, you must ensure that themapr-ranger-hive-pluginis 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 NameAny name for the service Username<cluster-admin>Password<cluster-admin-password>Jdbc.driverClassNameorg.apache.hive.jdbc.HiveDriverJdbc.urljdbc:hive2://FQDN:10000/;ssl=truepolicy.download.auth.usersCluster admin or component's main user - Test the connection between Ranger and Hive:

- Modify the following properties in the
install.propertiesin the Ranger Hive plug-in home directory (/opt/mapr/ranger/ranger-<version>/ranger-hive-plugin/install.properties):IMPORTANTTheREPOSITORY_NAMEmust be the same as theService Nameyou 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:
