zoukankan      html  css  js  c++  java
  • 2021.9.25 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&#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 ;

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

    三、明日计划

         继续安装

  • 相关阅读:
    下一周计划
    strategy模式
    Roc加载模块过程
    博客园开通了
    MO sample中的缓冲冲区的例子很简单的一个例子
    作为一个想成为程序员的人来说
    试试用live writer写博客到博客园
    Tomcat崩溃,无法访问
    The class Form1 can be designed, but is not the first class in the file.
    Exception in thread "Timer0" java.lang.NullPointerException
  • 原文地址:https://www.cnblogs.com/wmdww/p/14147508.html
Copyright © 2011-2022 走看看