Created on 07-16-2014 11:36 AM - edited 09-16-2022 02:02 AM
I use hive server 2 with sentry only let users to access "anon" database, however I still can see and use the "default" database:
beeline> !connect jdbc:hive2://192.168.1.123:10000 anon1 anon1
Connecting to jdbc:hive2://192.168.1.123:10000
Connected to: Hive (version 0.10.0)
Driver: Hive (version 0.10.0-cdh4.4.0)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://192.168.1.123:10000> show databases;
+----------------+
| database_name |
+----------------+
| anon |
| default |
+----------------+
2 rows selected (0.409 seconds)
And here is the role and group definition:
[groups]
anon_analyst = anon_select_tables_role, anon_insert_tables_role
[roles]
anon_select_tables_role = server=localhost->db=anon->table=*->action=SELECT
anon_insert_tables_role = server=localhost->db=anon->table=*->action=INSERT
And the user anon1 is in the unix group. However, Impala cannot access the default database which is the correct behavior. Could anybody knows how to solve the problem for hive? Thanks!
Created 08-21-2014 09:52 PM
Yes, the user group of impala node and hive nodes are the same.
I finally got the answer of my question. If I set "hive.sentry.restrict.defaultDB" to true in sentry-site.xml, the behavior of impala and hive will be the same. Because the default value of "hive.sentry.restrict.defaultDB" is false by default.
Refer line 48 of HiveAuthzConf.java of sentry source code.
Created 07-20-2014 07:40 AM
Created 08-21-2014 09:52 PM
Yes, the user group of impala node and hive nodes are the same.
I finally got the answer of my question. If I set "hive.sentry.restrict.defaultDB" to true in sentry-site.xml, the behavior of impala and hive will be the same. Because the default value of "hive.sentry.restrict.defaultDB" is false by default.
Refer line 48 of HiveAuthzConf.java of sentry source code.