启动hive错误:Exception in thread "main" java.lang.IllegalArgumentException

启动hive时报错了

报错信息:

Exception in thread "main" 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:205)
        at org.apache.hadoop.fs.Path.(Path.java:171)
        at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:659)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:582)
        at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:549)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:750)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
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:1823)
        at java.net.URI.(URI.java:745)
        at org.apache.hadoop.fs.Path.initialize(Path.java:202)
        ... 12 more

创建一个目录

mkdir /home/hadoop/apps/hive-2.3.2/tmp

编辑hive-site.xml,将system:java.io.tmpdir替换成刚刚创建目路径,我搜了下发现有四个地方需要修改

<property>
    <name>hive.exec.local.scratchdirname>
    <value>${system:java.io.tmpdir}/${system:user.name}value>
    <description>Local scratch space for Hive jobsdescription>
property>
<property>
    <name>hive.downloaded.resources.dirname>
    <value>${system:java.io.tmpdir}/${hive.session.id}_resourcesvalue>
    <description>Temporary local directory for added resources in the remote file system.description>
property>
<property>
    <name>hive.querylog.locationname>
    <value>${system:java.io.tmpdir}/${system:user.name}value>
    <description>Location of Hive run time structured log filedescription>
property>
<property>
    <name>hive.server2.logging.operation.log.locationname>
    <value>${system:java.io.tmpdir}/${system:user.name}/operation_logsvalue>
    <description>Top level directory where operation logs are stored if logging functionality is enableddescription>
property>

修改后的样子

<property>
    <name>hive.exec.local.scratchdirname>
    <value>/home/hadoop/apps/hive-2.3.2/tmp/${system:user.name}value>
    <description>Local scratch space for Hive jobsdescription>
property>
<property>
    <name>hive.downloaded.resources.dirname>
    <value>/home/hadoop/apps/hive-2.3.2/tmp/${hive.session.id}_resourcesvalue>
    <description>Temporary local directory for added resources in the remote file system.description>
property>
<property>
    <name>hive.querylog.locationname>
    <value>/home/hadoop/apps/hive-2.3.2/tmp/${system:user.name}value>
    <description>Location of Hive run time structured log filedescription>
property>
<property>
    <name>hive.server2.logging.operation.log.locationname>
    <value>/home/hadoop/apps/hive-2.3.2/tmp/${system:user.name}/operation_logsvalue>
    <description>Top level directory where operation logs are stored if logging functionality is enableddescription>
property>

重新启动就可以了

你可能感兴趣的:(Hive)