将 Sentry 配置为 show/hide 不同用户的不同数据库
Configure Sentry to show/hide different databases for different users
我有一个集群 运行 cdh-5.7.0 并配置了以下设置
- 带 kerberos 的 hadoop
- 具有 LDAP 身份验证的配置单元
- hive with sentry authorization(规则存储在 JDBC derby 中)
我的目标是限制用户查看我的系统中存在哪些数据库。
例如:
- User-A 在执行时应该只能看到数据库 DB-A
show databases
- User-B 在执行时应该只能看到数据库 DB-B
show databases
我按照文章 https://blog.cloudera.com/blog/2013/12/how-to-get-started-with-sentry-in-hive/ 来实现这一目标。但没有成功。
我取得的成就是
- 用户 A 只能 select 来自 DB-A 而不能来自 DB-B 的表。
- 用户 B 只能 select 来自 DB-B 而不是来自 DB-A 的表。
但是在执行show databases
时两者仍然可以看到DB-A和DB-B。但我想避免这种情况。
您有任何关于规则或设置看起来如何实现 运行 的提示吗?
谢谢
马可
根据你的描述和我从现有设置中学到的知识,如果是 Sentry v1.6+,你需要将以下 属性 添加到你的 hive-site.xml
:
<property>
<name>hive.metastore.filter.hook</name>
<value>org.apache.sentry.binding.metastore.SentryMetaStoreFilterHook</value>
</property>
即使您使用的是 CDH 5.7,MapR 5 documentation is providing some context. As well Sentry Service Interactions。
重新启动 Hive 服务后,您应该能够看到您期望的结果。
我有一个集群 运行 cdh-5.7.0 并配置了以下设置
- 带 kerberos 的 hadoop
- 具有 LDAP 身份验证的配置单元
- hive with sentry authorization(规则存储在 JDBC derby 中)
我的目标是限制用户查看我的系统中存在哪些数据库。 例如:
- User-A 在执行时应该只能看到数据库 DB-A
show databases
- User-B 在执行时应该只能看到数据库 DB-B
show databases
我按照文章 https://blog.cloudera.com/blog/2013/12/how-to-get-started-with-sentry-in-hive/ 来实现这一目标。但没有成功。 我取得的成就是
- 用户 A 只能 select 来自 DB-A 而不能来自 DB-B 的表。
- 用户 B 只能 select 来自 DB-B 而不是来自 DB-A 的表。
但是在执行show databases
时两者仍然可以看到DB-A和DB-B。但我想避免这种情况。
您有任何关于规则或设置看起来如何实现 运行 的提示吗?
谢谢 马可
根据你的描述和我从现有设置中学到的知识,如果是 Sentry v1.6+,你需要将以下 属性 添加到你的 hive-site.xml
:
<property>
<name>hive.metastore.filter.hook</name>
<value>org.apache.sentry.binding.metastore.SentryMetaStoreFilterHook</value>
</property>
即使您使用的是 CDH 5.7,MapR 5 documentation is providing some context. As well Sentry Service Interactions。
重新启动 Hive 服务后,您应该能够看到您期望的结果。