5

I have installed ubuntu 14 and hadoop 2.6.0 and Hive 0.14.0 in my VM player. In my Hive/conf there is no Hive-site.xml, so I created a new file. But I have getting error when I open Hive shell. If I delete the hive-site.xml file, I can open the shell. Why is this? what should I do? The Hive error is as follows:

> hduser@ubuntu:/usr/lib/hive/apache-hive-0.14.0-bin/bin$ hive
15/02/15 22:51:00 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
15/02/15 22:51:00 WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist

Logging initialized using configuration in jar:file:/usr/lib/hive/apache-hive-0.14.0-bin/lib/hive-common-0.14.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/hive/apache-hive-0.14.0-bin/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
    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.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
    at org.apache.hadoop.fs.Path.initialize(Path.java:206)
    at org.apache.hadoop.fs.Path.<init>(Path.java:172)
    at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:487)
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:430)
    ... 8 more
Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
    at java.net.URI.checkPath(URI.java:1804)
    at java.net.URI.<init>(URI.java:752)
    at org.apache.hadoop.fs.Path.initialize(Path.java:203)

Any Help would be great!

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
NJ_315
  • 1,863
  • 7
  • 22
  • 30
  • the warning tells you that the `hive.metastore.local ` key is not used. Try remove this conf from your hive-site.xml – amow Feb 16 '15 at 07:21
  • Is it necessary to have hive-site.xml? What is its purpose? – NJ_315 Feb 16 '15 at 11:53

7 Answers7

14

you need to add following configuration into hive-site.xml

<property>
    <name>hive.querylog.location</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Location of Hive run time structured log file</description>
  </property>

  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Local scratch space for Hive jobs</description>
  </property>

  <property>
    <name>hive.downloaded.resources.dir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
  </property>

remember to replace $HIVE_HOME with your hive directory

ssnijik
  • 151
  • 5
11

Put the following at the beginning of hive-site.xml

<configuration>
  <property>
    <name>system:java.io.tmpdir</name>
    <value>/tmp/hive/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>

See this question also

Jonathan L
  • 9,552
  • 4
  • 49
  • 38
5

First you need to copy configs from hive-default.xml.template to the created hive-site.xml

As mentioned in Hive Admin Configuration manual set the following configs

<property>
   <name>hive.querylog.location</name>
   <value>/tmp/hive</value>
   <description>Location of Hive run time structured log file</description>
</property>

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

<property>
   <name>hive.downloaded.resources.dir</name>
   <value>/tmp/hive</value>
   <description>Temporary local directory for added resources in the remote file system.</description>
</property>

It worked for me to start hive as well as beeline.

shriyog
  • 938
  • 1
  • 13
  • 26
2

if you using Hive-1.0.0 then create new directory named with log in HIVE_HOME then go to hive-site.xml find ${system:java.io.tmpdir} and replace with log directory path eg. /home/hduser/hive/log/........

1

To ALL Having Installed Latest Hadoop 2.x.y and Hive 1.x.y :

If You having Hive Start Problem:

Edit:

$HIVE_HOME/conf/hive-site.xml

<property>
  <name>hive.exec.local.scratchdir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Local scratch space for Hive jobs</description>
</property>



<property>
   <name>hive.querylog.location</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Location of Hive run time structured log file</description>
 </property>



 <property>
   <name>hive.downloaded.resources.dir</name>
    <value>$HIVE_HOME/iotmp</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
 </property>
0

relative path URISyntaxException exception is before of you must be specifying the relative path. I too have faced the similar issue while trying to start HMaster , the error was because i was using relative path to hdfs for hbase.rootdir property in hbase-site.xml on correcting the root dir path was able to start the Hmaster normally

path causing exception : hdfs://localhost:8020

correct path : hdfs://localhost:8020/hbase

Azam Khan
  • 516
  • 5
  • 12
0

just to add the following setting to the hive-site.xml

[hadoop@djt01 conf]$ vi hive-site.xml
< property>
    < name>hive.querylog.location< /name>
    < value>/home/hadoop/app/hive/iotmp< /value>
    < description>Location of Hive run time structured log file< /description>
< /property>

< property>
    < name>hive.exec.local.scratchdir< /name>
    < value>/home/hadoop/app/hive/iotmp< /value>
    < description>Local scratch space for Hive jobs< /description>
< /property>

< property>
    < name>hive.downloaded.resources.dir< /name>
    < value>/home/hadoop/app/hive/iotmp< /value>
    < description>Temporary local directory for added resources in the remote file system.< /description>
< /property>

save&restart hive

  [hadoop@djt01 hive]$ hive
    hive> show databases;
    OK
    default
    Time taken: 3.684 seconds, Fetched: 1 row(s)
    hive>
HbnKing
  • 1,762
  • 1
  • 11
  • 25