【问题标题】:Grant Permission in Hive在 Hive 中授予权限
【发布时间】:2015-05-06 14:49:19
【问题描述】:

我正在尝试使用 Hortonworks Sandbox HDP2.2 作为单节点系统在 Hive 14.0 上设置授予权限。这个问题类似于 3 月份未回答的问题:grant permissions in hive does not work on hdp2.2。

我按照a Hive-Wiki的配置步骤操作。

登录 hive shell (ssh with root) 后,我尝试了:

CREATE ROLE testing;

FAILED:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1。无法为 root 检索角色:此配置中禁用了远程 Metastore 的 Metastore 授权 api 调用。

如果我对另一个使用 hue / beeswax 的用户尝试相同的操作,则查询完成。如果我这样做了

SHOW ROLES;

我收到此错误,没有任何日志详细信息:

预期状态已完成,但发现错误

我的设置是这些(用 blanc 制作标签以在此处显示它们)

  • hive-site.xml(hive-wiki-link 中列出的那些)

    <property>
      <name>hive.server2.enable.doAs</name>
      <value>false</value>
    </property>
    <property>
      <name>hive.users.in.admin.role</name>
      <value>hue,hive</value>
    </property>
    <property>
      <name>hive.security.metastore.authorization.manager</name>
      <value>org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider,org.apache.hadoop.hive.ql.security.authorization.MetaStoreAuthzAPIAuthorizerEmbedOnly</value>
    </property>
    <property>
      <name>hive.security.authorization.manager</name>
      <value>org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdConfOnlyAuthorizerFactory</value>
    </property>
    
  • hiveserver2-site.xml(所有设置)

    <property>
        <name>hive.security.authorization.enabled</name>
        <value>true</value>
    </property>
    <property>
        <name>hive.security.authorization.manager</name>
        <value>org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory</value>
    </property>
    <property>
        <name>hive.security.authenticator.manager</name>
        <value>org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator</value>
    </property>
    <property>
        <name>hive.metastore.uris</name>
        <value>''</value>
    </property>
    <property>
        <name>hive.conf.restricted.list</name>
        <value>hive.security.authorization.enabled,hive.security.authorization.manager,hive.security.authenticator.manager</value>
    </property>
    

希望有人有想法。

[编辑]hive-site.xml 中的设置已经设置 - 我没有做任何更改。

[Edit2]更改设置后,我做了 hiveserver2 restart 并重新启动了沙箱。

[Edit3]每个用户都会收到错误消息,而不仅仅是 root 用户(您可以在错误消息中看到它)。如果我尝试具有管理员角色 (hive-site.xml) 的用户,例如“hive”,我会遇到同样的错误。

【问题讨论】:

    标签: hadoop hive hortonworks-data-platform metastore


    【解决方案1】:

    能够使其可运行 - thanks to Thejas Nair of Hortonworks。

    以下是要点:

    • 您应该使用 Ambari 更改所有设置。
    • 不要更改hive.metastore.uris-setting
    • 手动更改 hive.security.authorization.manager 的 hiveserver2-site.xml 属性
    • 复制hiveserver2-site.xml到/etc/hive/conf.server/
    • 重启 hiveserver2
    • 仅对 SQL 权限使用直线

    【讨论】:

      猜你喜欢
      • 2015-05-26
      • 2016-08-24
      • 2015-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      相关资源
      最近更新 更多