2016-01-13 74 views
2

我有一個4節點的cloudera集羣,啓用kerberos並使用Sentry保護Hive服務。Grant在Sentry創建外部表

當我使用配置單元用戶創建表時,我可以這樣做,因爲它具有數據庫默認的所有權限。

0: jdbc:hive2://clnode4:10000/default> create table t123 (a int); 
No rows affected (0.204 seconds) 
0: jdbc:hive2://clnode4:10000/default> show tables from default; 
+--------------+--+ 
| tab_name | 
+--------------+--+ 
| t1   | 
| t12   | 
| t123   | 
+--------------+--+ 
3 rows selected (0.392 seconds) 

但是,當我試圖創建具有相同的用戶蜂巢我得到如下錯誤

0: jdbc:hive2://clnode4:10000/default> create external table t1_ex (a string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LOCATION 'hdfs:///user/olap/KyvosDemo/Distance.csv'; 
Error: Error while compiling statement: FAILED: SemanticException No valid privileges 
User hive does not have privileges for CREATETABLE (state=42000,code=40000) 

我提供的URI的所有訪問,以及來自全被我同ENV一個外部表讀取外部表的數據。

有沒有什麼辦法可以在哨兵中爲用戶提供創建外部表格的幫助會很大。

回答

0

我能夠通過授予服務器上的所有權限蜂巢用戶如下

grant all on server server1 to role hive; 

角色蜂房被分配到蜂巢用戶解決問題。

編輯

在這一個可以找到與屬性名蜂巢配置的服務器名稱「hive.sentry.server」

更多幫助