当启动hive的时候遇到如下错误:

Hive启动时,遇到java.net.URISyntaxException: Relative path in absolute URI_HDFS


解决办法:

1.创建一个工作目录

mkdir /opt/hive

2.在hive1.2 的配置文件hive-site.xml中修改如下配置,修改成绝对路径:

 

<property>
    <name>hive.exec.scratchdir</name>
    <value>/opt/hive/tmp</value>
    <description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/<username> is created, with ${hive.scratch.dir.permission}.</description>
  </property>
  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>/opt/hive/hivedir</value>
    <description>Local scratch space for Hive jobs</description>
  </property>
  <property>
    <name>hive.downloaded.resources.dir</name>
    <value>/opt/hive/resouces</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
  </property>
  <property>
    <name>hive.server2.logging.operation.log.location</name>
    <value>/opt/hive/operation_logs</value>
    <description>Top level directory where operation logs are stored if logging functionality is enabled</description>
  </property>