Hive安装之遇到的错误

发布时间:2022-07-04 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Hive安装之遇到的错误脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

今天主要进行了Hive的安装与配置

学习视频:尚硅谷大数据教程

在这里记录一下安装过程中遇到的一些错误,主要问题集中在 hive-sITe.XMl 文件中

1、Hive启动报错

com.ctc.wstx.exc.WstxparsingException: Illegal character entity: expansion character

经过查询发现在 hive-site.xML 的 第3215行 (具体行数看错误信息),字符中包含特殊字符(😶)

  <PRoPErty>
    <name>hive.txn.xlock.iow</name>
    <value>true</value>
	<!--
    <description>
      Ensures commands with OVERWRITE (such as INSERT OVERWRITE) acquire Exclusive locks for&amp;#8;transactional tables.  This ensures that inserts (w/o overwrite) running concurrently
      are not hidden by the INSERT OVERWRITE.
    </description>
	-->
  </property>

解决办法:把这个 <description></description>注释掉

2、找不到 hive-site.xml

按照视频教学在启动Hive,以及查看数据库,数据表信息时出现 “找不到 hive-site.xml文件 ”错误

视频的顺序略有问题,这里我采用了另一篇博文的建议:hive 0.12 安装配置

(1)进入hive下的conf目录,将 hive-env.sh.template、hive-exec-LOG4j.properties.template、hive-log4j.properties.template重命名,去掉".template"

(2)将hive-default.xml.template重命名为hive-site.xml 

(3)(hive-env.sh.template文件中存在一个bug,第2000行,<value>auth</auth>,应该改成<value>auth</value>,否则启动时会报错

            这个错误我没有找到,因为我的这个文件里根本就没有2000行.....

3、Hive启动报错

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

结合网络建议,我采取了以下两种方案(不知道具体哪个好使,有同样问题的就都改吧)

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

例如:

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

改为:

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

3.2 修改如下属性

<property>
    <name>hive.exec.scratchdir</name>
    <value>/tmp/hive</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}/&lt;username&gt; is created, with ${hive.scratch.dir.permission}.</description>
  </property>

  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>/tmp/hive/local</value>
    <description>Local scratch space for Hive jobs</description>
  </property>

  <property>
    <name>hive.downloaded.resources.dir</name>
    <value>/tmp/hive/resources</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
  </property>

注意:由于借鉴了博文,所以在后续视频学习的过程中有些步骤有些许改动;

例如后期它没有将hive-default.xml.template重命名为hive-site.xml ,而是重新创建了hive-site.xml ;

所以在插入代码时要找到相对应位置,进行修改。

 

脚本宝典总结

以上是脚本宝典为你收集整理的Hive安装之遇到的错误全部内容,希望文章能够帮你解决Hive安装之遇到的错误所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。