prateek
prateek

Reputation: 23

I have hadoop 1.2.1 and have hive 0.14.0

hduser@Connected:~$ hive

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-0.14.0.jar!/hive-log4j.properties
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:672)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
Caused by: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x
    at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:529)
    at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:478)
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:430)

I have created the hive directories in hadoop as:

hadoop fs -mkdir /usr/hive/warehouse

and set permissions for the table:

hadoop fs -chmod g+w /usr/hive/warehouse

but its still not working? what should I do?

Upvotes: 0

Views: 2433

Answers (2)

Rajendra
Rajendra

Reputation: 53

Check the value for the below tag on hive-site.xml, then change the permission for the folder mentioned

<property>
<name>hive.exec.local.scratchdir</name>
<value>/tmp/mydir</value>
<description>Local scratch space for Hive jobs</description>
</property>

hadoop fs -rmr /tmp/mydir;
hadoop fs -mkdir /tmp/mydir;
hadoop fs -chmod 777 /tmp/mydir;
hadoop fs -chmod -R 777 /tmp/mydir;

Upvotes: 0

SachinJose
SachinJose

Reputation: 8522

Looks like the HDFS directory /tmp/hive is missing or doesn't have enough permission to write files inside. Execute the following command for assigning proper permission.

Switch to HDFS admin user first (sudo -su hdfs command can be used), then execute the following commands.

hadoop fs -chmod 777 /tmp;
hadoop fs -mkdir /tmp/hive;
hadoop fs -chmod -R 777 /tmp/hive;

Upvotes: 3

Related Questions