hive遇到的问题:The ownership on the staging directory /tmp/hadoop-yarnis not as expectedThe directory mus

By | 2019年1月31日


hive history file=/tmp/hadoop/hive_job_log_hadoop_201407010908_503942368.txt
hive>select count(*) from test;

后出现: The ownership on the staging directory /tmp/hadoop-yarn/staging/root/.staging is not as expected. It is owned by hive. The directory must be owned by the submitter root or by root
	at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(
	at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(
	at org.apache.hadoop.mapreduce.Job$
	at org.apache.hadoop.mapreduce.Job$
	at Method)


hadoop fs -chown -R root:root /tmp


chmod: changing permissions of '/tmp/hadoop-yarn': Permission denied: user=root, access=EXECUTE, inode="/tmp":hive:hive:drwxrwx--



hive> SELECT COUNT(*) FROM test;
Query ID = root_20180128162626_f875d94a-9ada-47c0-8af8-b9b37271c64a
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Starting Job = job_1517036563281_0005, Tracking URL = http://master:8088/proxy/application_1517036563281_0005/
Kill Command = /usr/local/hadoop/bin/hadoop job  -kill job_1517036563281_0005
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1
2018-01-28 16:26:58,698 Stage-1 map = 0%,  reduce = 0%
2018-01-28 16:27:06,402 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 1.32 sec
2018-01-28 16:27:13,780 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU 2.05 sec
MapReduce Total cumulative CPU time: 2 seconds 50 msec
Ended Job = job_1517036563281_0005
MapReduce Jobs Launched: 
Stage-Stage-1: Map: 1  Reduce: 1   Cumulative CPU: 2.05 sec   HDFS Read: 6436 HDFS Write: 2 SUCCESS
Total MapReduce CPU Time Spent: 2 seconds 50 msec
Time taken: 33.905 seconds, Fetched: 1 row(s)