Centos7安装hive3.1.2遇到报错

本文解决Hive启动过程中的日志错误、非法字符实体、URISyntaxException等问题,通过修改hive-site.xml配置文件中的路径设置及高可用性参数,确保Hive服务稳定运行。

查找hive启动日志

默认名是hive.log

[root@Master bin]# find / -name hive.log
/tmp/root/hive.log

Q1 Illegal character entity: expansion character (code 0x8

hive-site.xml有未识别的字符,需要删除,比如报错

xception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x8
 at [row,col,system-id]: [3215,96,"file:/opt/apache-hive-3.1.2/conf/hive-site.xml"]

查看文件 hive-site.xml
在3215行,96列出附近找到

查找:fortransactional
删除即可

Q2 Caused by: java.net.URISyntaxException: Relative path in absolute URI: KaTeX parse error: Expected '}', got 'EOF' at end of input: …a.io.tmpdir%7D/%7Bsystem:user.name%7D

修改hive-site.xml ,修改所有${…}之类的value值,写上绝对路径.
部分修改如下(可以搜索name标签内名字查找)

<property>
    <name>hive.downloaded.resources.dir</name>
    <!-- 修改这里的value -->
    <value>/opt/apache-hive-3.1.2/resources</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/apache-hive-3.1.2/log</value>
    <description>Top level directory where operation logs are stored if logging functionality is enabled</description>
  </property>
  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>/opt/apache-hive-3.1.2/scratchdir</value>
    <description>Local scratch space for Hive jobs</description>
  </property>
  <property>
    <name>hive.querylog.location</name>
    <value>/opt/apache-hive-3.1.2/querylog</value>
    <description>Location of Hive run time structured log file</description>
  </property>

报错server.HiveServer2: Error starting HiveServer2 on attempt 1, will retry in 60000ms

修改hive-site.xml,将下面value改为true

  <property>
    <name>hive.server2.active.passive.ha.enable</name>
    <value>true</value>
    <description>Whether HiveServer2 Active/Passive High Availability be enabled when Hive Interactive sessions are enabled.This will also require hive.server2.support.dynamic.service.discovery to be enabled.</description>
  </property>

参考链接:
https://stackoverflow.com/questions/29602670/using-hive-got-exception-java-lang-noclassdeffounderror-org-apache-tez-dag-api

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值