zoukankan      html  css  js  c++  java
  • hive 安装和部署

    1.先安装好hdfs和mapreduce

    2.下载hive的安装包,

    下载地址:https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallingHivefromaStableRelease
    

      

    3.配置系统环境变量

      修改 /etc/profile 文件  vi /etc/profile 来修改(root用户操作):

    设置 Hive环境变量  
    # Hive environment  
    export HIVE_HOME=/home/hadoop/cloud/apache-hive-2.1.1-bin  
    export PATH=$HIVE_HOME/bin:$HIVE_HOME/conf:$PATH  
    

      

    使环境变量生效:  
    source /etc/profile  
    

    4.创建必要的目录

    $HADOOP_HOME/bin/hadoop fs -mkdir -p /user/hive/warehouse  
    $HADOOP_HOME/bin/hadoop fs -mkdir -p /tmp/hive/  
    hadoop fs -chmod 777 /user/hive/warehouse  
    hadoop fs -chmod 777 /tmp/hive  
    

    5../conf/hive-default.xml 文件新增属性

     <property>
        <name>system:java.io.tmpdir</name>
        <value>自定义的文件路径</value>
        <description/>
      </property>
    

    6.设置mysql关联hive

    在hive/conf/目录下创建hive-site.xml文件

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>  
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>  
    <configuration>  
       <property>  
            <name>javax.jdo.option.Conne  l://192.168.169.134:3306/hive?createDatabaseIfNotExist=true</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>123456</value>  
        </property>  
        <property>    
       <name>hive.metastore.schema.verification</name>    
       <value>false</value>    
        <description>    
        Enforce metastore schema version consistency.    
        True: Verify that version information stored in metastore matches with one from Hive jars.  Also disable automatic    
              schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures    
              proper metastore schema migration. (Default)    
        False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.    
        </description>    
     </property>   
    </configuration>  
    

    新增mysql-connector包

    将其(如mysql-connector-java-5.1.15-bin.jar)拷贝到$HIVE_HOME/lib下即可。
    

    初始化数据库

     
         $HADOOP_HOME/bin/schematool  -dbType mysql  -initSchema
    

    run hive

    $HADOOP_HOME/bin/hive
    

      

  • 相关阅读:
    【BZOJ 1013】 [JSOI2008]球形空间产生器sphere
    【codeforces 779A】Pupils Redistribution
    【codeforces 779B】Weird Rounding
    【codeforces 779C】Dishonest Sellers
    Residential Gateway System for Home Network Service
    互联网大规模数据分析技术(自主模式)第五章 大数据平台与技术 第10讲 大数据处理平台Hadoop
    大数据系统基础(自主模式) 2.1大数据和云计算关系概述
    设计模式(10) 外观模式(FACADE)
    命令模式(Command Pattern)
    设计模式(三)建造者模式Builder(创建型)
  • 原文地址:https://www.cnblogs.com/chengjunhao/p/7692299.html
Copyright © 2011-2022 走看看