zoukankan      html  css  js  c++  java
  • Hive的安装部署

    1.环境准备

    1.1软件版本

    hive-0.14 下载地址

    2.配置

    安装hive的前提,必需安装好hadoop环境,可以参考我之前Hadoop社区版搭建,先搭建好hadoop环境;接下来我们开始配置hive

    2.1环境变量

    sudo vi /etc/profile
    HIVE_HOME=/home/hadoop/source/hive-0.14.0
    PATH=$HIVE_HOME/bin
    export  HIVE_HOME 

    2.2hive-site.xml

    <configuration>
    <property>   
      <name>datanucleus.fixedDatastore</name>   
      <value>false</value>   
    </property>
    <property>
      <name>hive.metastore.execute.setugi</name>
      <value>true</value>
    </property>
    
    <property>
      <name>hive.metastore.warehouse.dir</name>
      <value>/home/hive/warehouse</value>
      <description>location of default database for the warehouse</description>
    </property>
    
    <!-- metadata database connection configuration -->
    
    <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://10.211.55.18:3306/hive?useUnicode=true&amp;characterEncoding=UTF-8&amp;createDatabaseIfNotExist=true</value>
      <description>JDBC connect string for a JDBC metastore</description>
    </property>
    
    <property>
      <name>javax.jdo.option.ConnectionDriverName</name>
      <value>com.mysql.jdbc.Driver</value>
      <description>Driver class name for a JDBC metastore</description>
    </property>
    
    <property>
      <name>javax.jdo.option.ConnectionUserName</name>
      <value>root</value>
      <description>username to use against metastore database</description>
    </property>
    
    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>root</value>
      <description>password to use against metastore database</description>
    </property>
    
    <property>
      <name>hive.hwi.listen.host</name>
      <value>10.211.55.18</value>
      <description>This is the host address the Hive Web Interface will listen on</description>
    </property>
    
    <property>
      <name>hive.hwi.listen.port</name>
      <value>9999</value>
      <description>This is the port the Hive Web Interface will listen on</description>
    </property>
    
    <!-- configure hwi war package location -->
    <!--
    <property>
      <name>hive.hwi.war.file</name>
      <value>lib/hive-hwi-0.14.0.war</value>
      <description>This is the WAR file with the jsp content for Hive Web Interface</description>
    </property>
    -->
    </configuration>

     2.3hive-env.sh

    # Set HADOOP_HOME to point to a specific hadoop install directory
    HADOOP_HOME=/home/hadoop/source/hadoop-2.5.1

    2.4启动

    [hadoop@cloud001 ~]$ hive
    
    Logging initialized using configuration in file:/home/hadoop/source/hive-0.14.0/conf/hive-log4j.properties
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/hadoop/source/hadoop-2.5.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/home/hadoop/source/hive-0.14.0/lib/hive-jdbc-0.14.0-standalone.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.slf4j.impl.Log4jLoggerFactory]
    hive> 

    至此,hive配置完成。

    注:由于配置的是mysql驱动,所以需要把mysql的驱动包放到$HIVE_HOME/lib下

  • 相关阅读:
    ueditor富文本编辑在 asp.net MVC下使用步骤
    C#中Socket用法,多个聊天和单一聊天。
    事件与委托的联系和区别
    异步调用backgroudworker
    C#事件作用和用法
    如何遍历protected object转化为数组
    获取后台用户 token 的方法
    Magento2 中如何使用curl
    curl 错误排查方法
    Magento 2 REST API入门
  • 原文地址:https://www.cnblogs.com/smartloli/p/4201831.html
Copyright © 2011-2022 走看看