3
votes

I have installed Hive 2.1.0 with Derby 10.12.1.1 I can run Hive from:

$HIVE_HOME

But when I run from another location such as root or other places it throws an error:

Exception in thread "main" java.lang.RuntimeException: Couldn't create directory $/tmp/98e1866e-f8c7-451d-b958-1f773f0c4b02_resources at org.apache.hadoop.hive.ql.util.ResourceDownloader.ensureDirectory(ResourceDownloader.java:123) at org.apache.hadoop.hive.ql.util.ResourceDownloader.(ResourceDownloader.java:48) at org.apache.hadoop.hive.ql.session.SessionState.(SessionState.java:376) at org.apache.hadoop.hive.ql.session.SessionState.(SessionState.java:350) at org.apache.hadoop.hive.cli.CliSessionState.(CliSessionState.java:60) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:663) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

Can anybody help me out?

1
Are you running hive on hadoop or locally ? See if the user by which you are running hive has access /tmp directory .also check space in /tmp folder. Basically hive create intermideate folders for storing temporary data in /tmp foldernat
I am Running Hive On Hadoop 2.7.2 and yes the user has all the access of /tmp folderBrij Raj Kishore
Actually The Problem is that it is making $/tmp/ folder wherever i run hive. If the folder had permission to be written then there is no error but where there is no permission such as root it throws an error. And note it is making '$/tmp' folder not '/tmp' folder. Although I have specified the path of metdatastore in hive-site.xml but it is not taking it from that. Instead it is making new everytime whenever different location is assignedBrij Raj Kishore
root is not a location, it's a user. Did you mean /? You shouldn't execute from there.Mast
Mast the first directory is '/' which is called root directory. I wanted to start hive anywhere from the terminal which I was unable to do. It was the same scenario in other directories also. I was not abe to run hive from other directories other than $HIVE_HOMEBrij Raj Kishore

1 Answers

2
votes

I figure out the answer by editing hive-site.xml

<property>
<name>hive.downloaded.resources.dir</name>
<value>$/tmp/${hive.session.id}_resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>

and changed it to

<property>
<name>hive.downloaded.resources.dir</name>
<value>/home/hduser/hive/tmp/${hive.session.id}_resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>

And Problem is solved