添加服务

选择sentry

填写mysql账号密码

添加成功

Sentry与Hive/Impala集成
1.配置Hive集成Sentry
取消hiveserver2的用户模拟

确保hive用户能够提交MR任务
#
在Hive配置项中搜索“启用数据库中的存储通知”,勾选

在hive的配置中启用sentry

2.配置Impala集成Sentry

3.配置HDFS权限与Sentry同步
在HDFS配置项中搜索“ACL”,勾选。

4.配置HUE支持Sentry

5.查看hive组是否已经添加到sentry的admin.group中,也可以添加自定义的组,但是这个组必须在linux上存在
之后将admin用户添加到hive组中,admin用户就可以在HUE中给sentry添加role,否则将看不到添加role的按钮

6.配置sentry权限
此时hive账号登录HUE是无法查询数据的

需要使用admin账号登录HUE配置用户权限

新建hive用户和hive group,并将hive用户拉到hive组中,其中
filebrowser.access是hdfs文件浏览器按钮的权限
security.access是security按钮的权限
beeswax.access的query按钮的权限

之后就可以使用hive用户登录,就可以进行添加Group和添加Privileges

赋上所有db的all权限之后,hive用户就可以增删改查所有的hive表了
