java.net.URISyntaxException when starting HIVE

2019-01-16 19:52发布

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?

标签: hadoop hive
5条回答
手持菜刀,她持情操
2楼-- · 2019-01-16 20:11

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

查看更多
狗以群分
3楼-- · 2019-01-16 20:11

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.

查看更多
淡お忘
4楼-- · 2019-01-16 20:21

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

Your Answer

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 or ask your own question.

查看更多
劫难
5楼-- · 2019-01-16 20:30

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

查看更多
欢心
6楼-- · 2019-01-16 20:37

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

查看更多
登录 后发表回答
相关问题
查看全部
相关文章
查看全部
收藏的人(4)