zoukankan      html  css  js  c++  java
  • 1.3-1.4 hive环境部署

    一、

    官网:http://hive.apache.org/

    下载:http://archive.apache.org/dist/hive/

    GitHub:https://github.com/apache/hive


    二、伪分布式部署

    前提是hadoop环境已经部署好了;我用的之前的hadoop伪分布式环境;

    1、准备安装包、解压

    [root@hadoop-senior softwares]# tar zxf apache-hive-0.13.1-bin.tar.gz -C /opt/modules/

    2、重命名目录

    [root@hadoop-senior ~]# cd /opt/modules/
    
    [root@hadoop-senior modules]# ls
    apache-hive-0.13.1-bin  apache-maven-3.0.5  hadoop-2.5.0  jdk1.7.0_80
    
    [root@hadoop-senior modules]# mv apache-hive-0.13.1-bin/ hive-0.13.1
    
    [root@hadoop-senior modules]# ls
    apache-maven-3.0.5  hadoop-2.5.0  hive-0.13.1  jdk1.7.0_80

    3、hive-env.sh.template

    #先重命名为:hive-env.sh
    
    #修改以下两行
    HADOOP_HOME=/opt/modules/hadoop-2.5.0    #hadoop安装目录
    
    export HIVE_CONF_DIR=/opt/modules/hive-0.13.1/conf    #hive的conf目录

    4、在HDFS上创建数据目录

    #创建
    [root@hadoop-senior hadoop-2.5.0]# bin/hadoop fs -mkdir       /tmp            #我的/tmp已经存在
    [root@hadoop-senior hadoop-2.5.0]# bin/hadoop fs -mkdir -p /user/hive/warehouse
    
    #加权限
    bin/hadoop fs -chmod g+w   /tmp
    bin/hadoop fs -chmod g+w   /user/hive/warehouse

    5、进入hive

    #第一次进入可能有点慢
    [root@hadoop-senior hive-0.13.1]# bin/hive
    Logging initialized using configuration in jar:file:/opt/modules/hive-0.13.1/lib/hive-common-0.13.1.jar!/hive-log4j.properties
    hive> show databases;
    OK
    default
    Time taken: 0.01 seconds, Fetched: 1 row(s)
    hive> use default;   
    OK
    Time taken: 0.009 seconds
    
    #是不是有点mysql的感觉了,确实,甚至连命令都很像;

    6、使用

    hive> create table bf_log(ip string,user string,requesturl string);
    OK
    Time taken: 0.274 seconds
    hive> show tables;                                                 
    OK
    bf_log
    Time taken: 0.011 seconds, Fetched: 1 row(s)
    hive> select count(*) from bf_log;        #此时就会去执行MapReduce了,命令行中清晰可见,yarn的web中也有
  • 相关阅读:
    Weblogic 漏洞利用总结
    CVE-2017-9993 FFMpeg漏洞利用
    tomcat漏洞利用总结
    移动渗透测试杂记
    CORS漏洞利用检测和利用方式
    discuz mlv3.x命令注入
    DNS域传输漏洞利用总结
    redis未授权漏洞和主从复制rce漏洞利用
    CVE-2016-3714-ImageMagick 漏洞利用
    JAVA WEB EL表达式注入
  • 原文地址:https://www.cnblogs.com/weiyiming007/p/10731148.html
Copyright © 2011-2022 走看看