Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hive shell not opening when I have hive-site.xml

Tags:

hive

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!

like image 259
NJ_315 Avatar asked Feb 16 '15 07:02

NJ_315


People also ask

How do I open hive-site XML?

You can find hive-site. xml in /etc/hive/conf/, but if you're using Ambari to manage your cluster then do the modification in Ambari so it can deploy it to every host.

What does hive-site XML contain?

Reference material for adding security information to the hive-site. xml configuration file when setting up Kerberos for non-Ambari clusters. HiveServer2 supports Kerberos authentication for all clients.

Where is hive default XML template?

hive-default. xml. template is located in the conf directory in your installation root, and hive-site. xml should also be created in the same directory.


2 Answers

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

like image 115
ssnijik Avatar answered Oct 17 '22 19:10

ssnijik


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

like image 30
Jonathan L Avatar answered Oct 17 '22 18:10

Jonathan L