java.net.URISyntaxException when starting HIVE

2019-01-16 19:36发布

问题:

I am new in HIVE. I have already set up hadoop and it works well, and I want to set up Hive. When I start hive , it shows an error as

Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D

Are there any solutions?

回答1:

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

  <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 also question



回答2:

I figure it out myself. In the hive-site.xml, replace ${system:java.io.tmpdir}/${system:user.name} by /tmp/mydir as what has been told in https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration.



回答3:

Change in hfs-site.xml this properties

<name>hive.exec.scratchdir</name>
<value>/tmp/hive-${user.name}</value>

 <name>hive.exec.local.scratchdir</name>
 <value>/tmp/${user.name}</value>

<name>hive.downloaded.resources.dir</name>
<value>/tmp/${user.name}_resources</value>

<name>hive.scratch.dir.permission</name>
    <value>733</value>

restart hive metastore and hiveserver2



回答4:

I too have encountered the same error while starting HMaster for Hbase. this was corrected by specfying the path to directory on hdfs where you want to store hbase data in hbase.rootdir property of hbase-site.xml earlier i was using only relative path.

path causing exception : hdfs://localhost:8020

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



回答5:

Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D system:java.io.tmpdir - path
system:user.name - username

Above properties are system level properties which need to set by user, So hive site template didn't provide these, required manual configuration.

Set the above properties like using property tag with name value key pair in hive-site.xml, Its upto user level to choose the location of temp

<property>
    <name>system:java.io.tmpdir</name>
    <value>/user/local/hive/tmp/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>
share|improve this answer
-1

add property in hive-site.xml

<configuration>
<property>
  <name>hive.metastore.schema.verification</name>
  <value>false</value>
  <description>Will remove your error occurring because of metastore_db in shark</description>
</property>
</configuration>

add java and hadoop path in hive-env.sh according to your system.

# Set HADOOP_HOME to point to a specific hadoop install directory
export HADOOP_HOME=/home/user17/BigData/hadoop

#hive 
export HIVE_HOME=/home/user17/BigData/hive

# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=$HIVE_HOME/conf

and also set hive and hadoop path in .bashrc

export JAVA_HOME=/home/user17/jdk
export PATH=$PATH:$JAVA_HOME/bin

export HADOOP_INSTALL=/home/user17/BigData/hadoop
export PATH=$PATH:$HADOOP_INSTALL/bin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL

export HIVE_INSTALL=/home/user17/BigData/hive
export PATH=$PATH:$HIVE_INSTALL/bin

Note-- this all files path are set according to my system , you should give path according to your system. let me know if not work

share|improve this answer

Your Answer

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged hadoop hive or ask your own question.

收藏的人(0)

Ta的文章 更多文章
登录 后发表评论
0条评论
还没有人评论过~