您好,欢迎来到爱go旅游网。
搜索
您的当前位置:首页hive执行结果moveTask操作失败 setfacl: Permission denied

hive执行结果moveTask操作失败 setfacl: Permission denied

来源:爱go旅游网

Apache Hive 2.1.0 ,在执行"INSERT OVERWRITE TABLE ...... select "或者 "insert overwrite directory /tmp/data/hive-test "操作,如果生成的结果文件是多个时,执行结果文件moveTask操作会失败。最新的Apache Hive 2.1.1版本同样有该问题;Apache Hive 1.2.1版本的hive没有该问题。

spark程序时去往hive表中写数据。一开始是可以写入数据的写入一段时间后报错说是权限问题
报错信息如下:
setfacl: Permission denied. user=dyf is not the owner of inode=/user/hive/warehouse/***/.hive-staging_hive_2020-01-06_15-47-05_5_7400000999907592444-1

下面是源码中关于文件权限继承的开关代码:
HiveConf.ConfVars.HIVE_WAREHOUSE_SUBDIR_INHERIT_PERMS);
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;

产生问题的原因:
hive的查询结果在在进行move操作时,需要进行文件权限的授权,多个文件的授权是并发进行的,hive中该源码是在一个线程池中执行的,该操作在多线程时线程同步有问题的该异常,这是hive的一个bug,目前截止目前的最新版本Apache Hive 2.1.1还没有修复该问题;
可以通过关闭hive的文件权限继承 hive.warehouse.subdir.inherit.perms=false 来规避该问题。

解决方法:

hive.warehouse.subdir.inherit.perms=false   
  <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    <description>
      Set this to false if the table directories should be created
      with the permissions derived from dfs umask instead of
      inheriting the permission of the warehouse or database directory.
    </description>
  </property>
    
  

 

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- igat.cn 版权所有 赣ICP备2024042791号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务