1

我已经将 Kerberos 设置为 hive 的安全模型,但我正在努力获得正确的权限。现在用户可以很好地创建和删除数据库,但不能创建表:

hive> show databases;
OK
cpenney
default
Time taken: 0.051 seconds, Fetched: 2 row(s)
hive> drop database cpenney;
OK
Time taken: 0.098 seconds
hive> create database cpenney;
OK
Time taken: 0.062 seconds
hive> create table test ( hostgroup STRING );
Authorization failed:No privilege 'Create' found for outputs { database:cpenney}. Use show grant to get more details.
hive> show grant user cpenney on database cpenney;
OK
Time taken: 0.016 seconds
hive> grant all on database cpenney to user cpenney;
OK
Time taken: 0.022 seconds
hive> show grant user cpenney on database cpenney;
OK

database        cpenney
principalName   cpenney
principalType   USER
privilege       All
grantTime       Thu Sep 05 11:07:59 EDT 2013
grantor cpenney@REALM.COM
Time taken: 0.02 seconds, Fetched: 7 row(s)
hive> create table test ( hostgroup STRING );
Authorization failed:No privilege 'Create' found for outputs { database:cpenney}. Use show grant to get more details.

我正在使用以下设置(一些从这个粘贴中删除):

<property>
  <name>hive.security.authorization.enabled</name>
  <value>true</value>
</property>

<property>
  <name>hive.security.authorization.createtable.owner.grants</name>
  <value>ALL</value>
</property>

<property>
  <name>hive.security.metastore.authorization.enabled</name>
  <value>true</value>
 </property>

<property>
  <name>hive.metastore.authorization.storage.checks</name>
  <value>true</value>
 </property>

<property>
  <name>hive.security.metastore.authorization.manager</name>
  <value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveMetastoreAuthorizationProvider</value>
 </property>

<property>
  <name>hive.security.metastore.authenticator.manager</name>
  <value>org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator</value>
</property>

hive.security.authorization.createtable.owner.grants 选项似乎没有做任何事情。当我查看 /user/hive/warehouse 时,该文件由同一用户拥有,因此看起来是正确的。

我正在使用 hadoop 1.1.1 和 hive 0.11。

谢谢!

4

1 回答 1

3

将 hive.security.authorization.enabled 设置为 FALSE

您可以将 create 授予您的用户名。

更多细节:Hive 授权

谢谢, SSP

于 2014-02-18T07:37:40.630 回答