背景及问题
前天学习Pig,在dump某个关系时一直报错,内容如下
The ownership on the staging directory /tmp/hadoop-yarn/staging/songzeceng/.staging is not as expected. It is owned by Administrators. The directory must be owned by the submitter songzeceng or by songzeceng
解决方法
网上搜了很多方法,最后还是自己试出了解决方法:
以前启动pig用的是本地模式,这不对,应该用默认的MapReduce模式。
换言之,要用下面命令启动pig
pig
而不是
pig -x local
结语
附上我试过了另外两种方法,对我来说没有用,但保不齐对大家有用:
1、修改hdfs-site.xml文件,加入以下配置
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
2、给/tmp目录修改权限,命令如下
hadoop fs -chmod -R 777 /tmp