将 Sentry 配置为 show/hide 不同用户的不同数据库

Configure Sentry to show/hide different databases for different users

我有一个集群 运行 cdh-5.7.0 并配置了以下设置

我的目标是限制用户查看我的系统中存在哪些数据库。 例如:

我按照文章 https://blog.cloudera.com/blog/2013/12/how-to-get-started-with-sentry-in-hive/ 来实现这一目标。但没有成功。 我取得的成就是

但是在执行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 服务后,您应该能够看到您期望的结果。