hive数据库权限控制

1. 登陆hue,右上角

admin->Manage Users

增加Groups:business

设置权限:beeswax.access:Launch this application(2)

增加User:xcy,在Step2 添加Group[business]

2. 登陆hive参数配置平台,增加如下参数:

hive.security.authorization.enabled : true

hive.security.authorization.createtable.owner.grants : ALL

hive.security.authorization.task.factory:org.apache.hadoop.hive.ql.parse.authorization.HiveAuthorizationTaskFactoryImpl

3.Hadoop集群各节点都要增加用户xcy

[root@uhadoop-task1 ~]# useradd xuchaoyang
[root@uhadoop-task1 ~]# passwd xuchaoyang
[root@uhadoop-task1 ~]# gpasswd -a xuchaoyang hadoop

4.重启hive服务

5.打开hive client,执行如下操作:

hive> create role business;
hive> grant role business to user xuchaoyang ;
hive> grant select on database dws to role business;
hive> grant all to user root;
hive> show roles;

你可能感兴趣的:(hadoop/hive)