sentry配置

官方文档:http://www.cloudera.com/documentation/enterprise/5-4-x/topics/sg_policy_cm_config.html#concept_nt1_c1z_zp_unique_1

1.开启testing.mode(否则需要先配好Kerberos )
cm中hive的配置->sentry-site.xml添加 :
<property>
<name>sentry.hive.testing.mode</name>
<value>true</value>
</property>

2.使用local groups
hive配置->搜索hive.sentry.provide->"Sentry 用户至组映射类"设为org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider

3.配置策略文件路径
hive配置->hive.sentry.provider.resource

4.在数据库策略文件中允许 URI
hive配置->sentry.allow.uri.db.policyfile->check

5.确保数据仓库权限正确
$ sudo -u hdfs hadoop fs -chmod -R 771 /user/hive/warehouse
$ sudo -u hdfs hadoop fs -chown -R hive:hive /user/hive/warehouse

6.关闭HiveServer2 启用模拟
hive配置->hive.server2.enable.impersonation->uncheck

7.创建 sentry-provider.ini,put到步骤3中的路径中
格式实例:
[databases]
[groups]
admin = all_operation
ope = select_filtered
g12000128 = select_g12000128
access_log = select_access_log

[roles]
all_operation = server=dmp-hive->action=ALL,server=dmp-hive->uri=hdfs://user/m4/lib/
select_filtered = server=dmp-hive->action=SELECT
select_g12000128 = server=dmp-hive->db=g12000128->action=SELECT
select_access_log = server=dmp-hive->db=access_log->action=SELECT

#select_us = server=dmp-hive->db=filtered->table=events_usonly->action=SELECT

[users]
root = ope
admin = ope
fdc964ffa8f13cf35792989279451c46 = admin
456b7016a916a4b178dd72b947c152b7 = admin
infra = admin

8.yarn配置中确保allowed.system.users中有hive用户

9.hive配置中->hive.sentry.enabled->check

10.RESTART CLUSTER

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值