【问题标题】:FAILED: HiveAuthzPluginException Error getting permissions for hdfs失败:HiveAuthzPluginException 获取 hdfs 权限时出错
【发布时间】:2019-05-23 01:44:00
【问题描述】:

我正在尝试通过查询将数据从 hdfs 目录中的文件插入到 hive 表中:

$ jdbc:hive2://localhost:10000> LOAD DATA INPATH '/user/xyz/stdfiles/testtbl.txt' OVERWRITE INTO TABLE testdb.testtbl;

但查询失败导致:

错误:编译语句时出错:失败: HiveAuthzPluginException 获取权限时出错 hdfs://localhost:9000/user/xyz/stdfiles/testtbl.txt: null (状态=42000,代码=40000)

我已尝试通过以下命令授予权限,但没有错误:

$ hdfs dfs -chown -R stdfiles /user/xyz/stdfiles
$ hdfs dfs -chmod -R 777 /user/xyz/stdfiles/testtbl.txt

已检查:

$ hdfs dfs -ls /user/xyz/stdfiles
19/05/22 09:15:13 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
-rwxrwxrwx 1 stdfiles supergroup 6 2019-05-22 08:45 /user/xyz/stdfiles/testtbl.txt

通过期望的输出成功插入数据

【问题讨论】:

    标签: hadoop hive hdfs


    【解决方案1】:

    在 hadoop 配置文件 core-site.xml 中添加以下属性对我有用 :)

    <property>
         <name>hadoop.proxyuser.niazullah.hosts</name>
         <value>*</value>
    </property>
    
    <property>
         <name>hadoop.proxyuser.niazullah.groups</name>
         <value>*</value>
    </property>
    

    同时检查用户访问 hdfs:

    $ hdfs dfs -ls /user
    

    输出:

    drwxr-xr-x   - main supergroup          0 2019-05-22 13:22 /user/test
    

    其中“main”是用户更改它做蜂巢用户

    【讨论】:

    • 帮助!现在它在这里失败了:FAILED: SemanticException Line 1:17 Invalid path ''/user/xyz/stdfiles/abc.txt'': No files matching path file:/user/xyz/stdfiles/abc.txt
    猜你喜欢
    • 2022-11-30
    • 1970-01-01
    • 2010-12-20
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    • 2019-08-31
    • 2013-11-03
    相关资源
    最近更新 更多