一、安装hive插件
1、解压安装
# tar zxvf ranger-2.0.0-SNAPSHOT-hive-plugin.tar.gz -C /data1/hadoop/
2、修改install.properties
POLICY_MGR_URL=http://192.168.4.50:6080
REPOSITORY_NAME=hivedev
COMPONENT_INSTALL_DIR_NAME=/data1/hadoop/hive #hive安装目录
XAAUDIT.SOLR.ENABLE=true
XAAUDIT.SOLR.URL=http://192.168.4.50:6083/solr/ranger_audits
CUSTOM_USER=hduser
CUSTOM_GROUP=hduser
3、启动hive插件
# sudo ./enable-hive-plugin.sh
启动hive插件以后,默认生成hiveserver2-site.xml文件,或者在已经存在的该文件下添加如下信息:
hive.security.authorization.enabled
true
hive.security.authorization.manager
org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory
hive.security.authenticator.manager
org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator
hive.conf.restricted.li