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

解决方法

1、在hive文件夹下创建tmp文件夹

mkdir tmp

** 2、修改hive-site.xml文件**

将文件中的system:java.io.tmpdir替换为创建的tmp目录(例如 /usr/local/src/hive/tmp)

替换时可vim进入文件后直接在 ‘’ /system:java.io.tmpdir ‘’ 便可查找到 按n就可找到下一个


    hive.exec.local.scratchdir</name>
    ${system:java.io.tmpdir}/${system:user.name}</value>
    Local scratch space for Hive jobs</description>
</property>

    hive.downloaded.resources.dir</name>
    ${system:java.io.tmpdir}/${hive.session.id}_resources</value>
    Temporary local directory for added resources in the remote file system.</description>
</property>

    hive.querylog.location</name>
    ${system:java.io.tmpdir}/${system:user.name}</value>
    Location of Hive run time structured log file</description>
</property>

    hive.server2.logging.operation.log.location</name>
    ${system:java.io.tmpdir}/${system:user.name}/operation_logs</value>
    Top level directory where operation logs are stored if logging functionality is enabled</description>
</property>

替换后


    hive.exec.local.scratchdir</name>
    ${/usr/local/src/hive/tmp}/${system:user.name}</value>
    Local scratch space for Hive jobs</description>
</property>

    hive.downloaded.resources.dir</name>
    ${/usr/local/src/hive/tmp}/${hive.session.id}_resources</value>
    Temporary local directory for added resources in the remote file system.</description>
</property>

    hive.querylog.location</name>
    ${/usr/local/src/hive/tmp}/${system:user.name}</value>
    Location of Hive run time structured log file</description>
</property>

    hive.server2.logging.operation.log.location</name>
    ${/usr/local/src/hive/tmp}/${system:user.name}/operation_logs</value>
    Top level directory where operation logs are stored if logging functionality is enabled</description>
</property>

你可能感兴趣的:(Hive)