栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > .Net

Hive 启动报错:java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7

.Net 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Hive 启动报错:java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7

文章目录
  • 环境描述
  • 问题现象
  • 问题分析
  • 解决方案

环境描述
  • 操作系统:CentOS 6.5
  • Hadoop:Apache Hadoop 2.7.7
  • Hive: 2.3.7
问题现象

Hive 启动时报错:

[deploy@master apache-hive-2.3.7-bin]$ HADOOP_USER_NAME=hdfs hive
which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/data/software/jdk1.8.0_144/bin:/data/software/hadoop-2.7.7/bin:/data/software/hadoop-2.7.7/sbin:/data/apache-maven-3.6.3/bin:/data/software/apache-hive-2.3.7-bin/bin:/home/deploy/.local/bin:/home/deploy/bin:/data/software/jdk1.8.0_144/bin:/data/software/hadoop-2.7.7/bin:/data/software/hadoop-2.7.7/sbin:/data/apache-maven-3.6.3/bin:/data/software/apache-hive-2.3.7-bin/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/data/software/apache-hive-2.3.7-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/software/hadoop-2.7.7/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/data/software/apache-hive-2.3.7-bin/lib/hive-common-2.3.7.jar!/hive-log4j2.properties Async: true
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:663)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:586)
        at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:553)
        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:226)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:141)
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
问题分析

这个报错信息显示是某个路径写法不对:

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

这个路径应该是 Hive 配置文件 hive-site.xml 中配置的,查一下:

  
    hive.exec.local.scratchdir
    ${system:java.io.tmpdir}/${system:user.name}
    Local scratch space for Hive jobs
  
  
    hive.downloaded.resources.dir
    ${system:java.io.tmpdir}/${hive.session.id}_resources
    Temporary local directory for added resources in the remote file system.
  
  
    hive.querylog.location
    ${system:java.io.tmpdir}/${system:user.name}
    Location of Hive run time structured log file
  
  
    hive.server2.logging.operation.log.location
    ${system:java.io.tmpdir}/${system:user.name}/operation_logs
    Top level directory where operation logs are stored if logging functionality is enabled
  
  
    hive.exec.local.scratchdir
    ${system:java.io.tmpdir}/${system:user.name}
    Local scratch space for Hive jobs
  
  
    hive.downloaded.resources.dir
    ${system:java.io.tmpdir}/${hive.session.id}_resources
    Temporary local directory for added resources in the remote file system.
  

配置文件中有挺多地方配了 ${system: } 这种格式的值的,这些值是默认的配置模板文件 hive-default.xml.template 中配好的,那为什么模板文件中配好的东西不能直接用呢?

官网的文档中没有具体的描述原因,我理解这种方式应该是让 Java 程序去通过 System 类 来读取这些配置项,比如:

System.getProperty("java.io.tmpdir");
解决方案

可以直接将配置文件中${system:java.io.tmpdir} 这类配置值中的system: 直接去掉,改为 ${java.io.tmpdir},让 Java 程序直接读${java.io.tmpdir}即可。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/908443.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号