zoukankan      html  css  js  c++  java
  • Hive安装

    一、下载:http://hive.apache.org/,选择合适的版本,Hive 1.X版本要求Hadoop2.x以上版本,Jdk1.7以上

    这里选择1.2.1版本

    二、安装jdk

    三、安装Hadoop

    四、安装Hive

    1、tar -zxvf apache-hive-1.2.1-bin.tar.gz

     vi ~/.bash_profile,加上:

    export HIVE_HOME=/data/apache-hive-1.2.1-bin
    export PATH=$PATH:${HIVE_HOME}/bin
    

      

    2、MySQL:

    建立hive数据库,:

    create database hive;
    commit;

     3、cd hive/conf 

      vi hive-site.xml

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    
    <configuration>
        <property>
            <name>hive.metastore.local</name>
            <value>true</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionURL</name>
            <value>jdbc:mysql://192.168.51.143:3306/hive?characterEncoding=UTF-8</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>com.mysql.jdbc.Driver</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>root</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value>root</value>
        </property>
    </configuration>
    

      4、把mysql的驱动jar包复制到lib目录

    5、启动Hive,只要能连接到mysql数据库,那么hive会自动创建表,和插入相关数据。

    输入hive

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/data/hadoop-2.7.1/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/data/spark-1.5.1-bin-hadoop2.6/lib/spark-assembly-1.5.1-hadoop2.6.0.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]
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/data/hadoop-2.7.1/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/data/spark-1.5.1-bin-hadoop2.6/lib/spark-assembly-1.5.1-hadoop2.6.0.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]
    16/09/27 19:20:33 WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist
    
    Logging initialized using configuration in jar:file:/data/apache-hive-1.2.1-bin/lib/hive-common-1.2.1.jar!/hive-log4j.properties
    Java HotSpot(TM) Client VM warning: You have loaded library /data/hadoop-2.7.1/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    hive>
    

      

  • 相关阅读:
    Unity中将相机截图保存本地后颜色变暗的解决方法
    《无间道》亚索盲僧上演天台对决——开发者日志(二)_为人物添加动画
    《无间道》亚索盲僧上演天台对决——开发者日志(一)_项目启动
    CCF推荐期刊会议列表(2019第五版)——《中国计算机学会推荐国际学术会议和期刊目录》
    用3dMax给lol人物模型制作表情动画并导入Unity
    与100个诺手一起跨年
    C#发邮件
    SQL的各种连接Join详解
    Oracle&SQLServer中实现跨库查询
    SQL SERVER/ORACLE连接查询更简洁方便的方式
  • 原文地址:https://www.cnblogs.com/fillPv/p/5913810.html
Copyright © 2011-2022 走看看