【问题标题】:Issue with Hive and Google Cloud StorageHive 和 Google Cloud Storage 的问题
【发布时间】:2018-12-05 00:03:19
【问题描述】:

请指教:

我已经使用虚拟机的实例在 GCP 中安装了 hadoop 2.6.5 版本的集群。使用 GCP 连接器并由 hdfs 指向使用 gs 存储桶。在coresite.xml 中添加了以下 2 个条目:

google.cloud.auth.service.account.json.keyfile=<Path-to-the-JSON-file> 
fs.gs.working.dir=/

当使用 hadoop gs -ls / 时工作正常,但是当我创建一个配置单元表时

CREATE EXTERNAL TABLE test1256(name string,id  int)   LOCATION   'gs://bucket/';

我收到以下错误:

错误:处理语句时出错:FAILED:执行错误, 从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1。 MetaException(消息:java.security.AccessControlException:权限 拒绝:user=hdpuser1,path="gs://bucket/":hive:hive:drwx------) (状态=08S01,代码=1)

【问题讨论】:

    标签: hive google-cloud-storage


    【解决方案1】:

    正如错误消息所暗示的,您遇到了权限问题。首先,检查您的 Google Cloud Console 以确保您有 Cloud Storage IAM permissions 来执行该操作。接下来,确保您对 hdfs 中的“hdpuser1”用户具有正确的权限:

    • 以 hdfs 用户身份登录:su hdfs
    • 您也可以更改权限:hdfs dfs -chown -R &lt;username_of_new_owner&gt; /user

    然后执行以下操作:

    hadoop fs -mkdir -p /user/hive/warehouse
    hadoop fs -mkdir /tmp
    hadoop fs -chmod -R 777 /user/hive
    hadoop fs -chmod 777 /tmp
    

    然后尝试再次创建 Hive 表。我希望这会有所帮助。

    找到类似的答案here。以及 GitHub 中针对 performing a test with Hive 的完整指南

    【讨论】:

      【解决方案2】:

      我今天遇到了这个错误,并且能够通过添加以下两个属性来解决它:

      fs.gs.reported.permissions=777
      fs.gs.path.encoding=uri-path
      

      both 进入 core-site.xml 和 hive-site.xml(通过在 ambari 中转到 HDFS 和 Hive 服务的高级配置)。

      如果只在 core-site.xml 中配置,则 hive 外部表创建会失败。

      【讨论】:

        猜你喜欢
        • 2016-02-06
        • 2016-01-19
        • 2018-12-31
        • 1970-01-01
        • 2019-04-13
        • 1970-01-01
        • 1970-01-01
        • 2019-10-12
        • 1970-01-01
        相关资源
        最近更新 更多