docker安装hive笔记
前两篇文章介绍了docker的基本命令如何安装hadoop
那么大家会比较了解docker的基本语法的安装过程。那么咱们今天来一起安装一下hive。
安装
1、下载gitHub,地址:https://github.com/prasanthj/docker-hive-on-tez。如果背墙了,可以选择下载zip。进入目录之后就能看见如下内容:
@~/git/github/docker-hive-on-tez-master $ ls
Dockerfile datagen.py hive-log4j.properties store_sales.sql
LICENSE hive-0.14 hive-site.xml store_sales.txt
README.md hive-bootstrap.sh postgresql.conf
2、安装:
docker build --no-cache=true -t local-hive-on-tez .
这是一个漫长的过程,喝一杯咖啡,该干嘛干嘛,几个小时之后回来......
3、进入系统
docker --tls run -i -t -P local-hive-on-tez /etc/hive-bootstrap.sh -bash
Starting postgresql server...
/
-- :: GMT LOG: database system was interrupted; last known up at -- :: GMT
-- :: GMT LOG: database system was not properly shut down; automatic recovery in progress
-- :: GMT LOG: redo starts at /1782A58
4、查看hive
root@2c1282c522bf:/# hive -f /opt/files/store_sales.sql Logging initialized using configuration in file:/usr/local/hive-dist/apache-hive-0.15.-SNAPSHOT-bin/conf/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.5./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
5、端口映射
如果你只想登录虚拟机玩玩,这个就足够了,可是还想看看这个hadoop运行的怎么样,需要在页面查看一下
@~/VirtualBox VMs/boot2docker-vm $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2c1282c522bf local-hive-on-tez:latest "/etc/hive-bootstrap 39 hours ago Up 6 hours 0.0.0.0:49181->8032/tcp, 0.0.0.0:49182->50075/tcp, 0.0.0.0:49183->50010/tcp, 0.0.0.0:49184->50090/tcp, 0.0.0.0:49185->8031/tcp, 0.0.0.0:49186->8040/tcp, 0.0.0.0:49187->8088/tcp, 0.0.0.0:49188->22/tcp, 0.0.0.0:49189->50020/tcp, 0.0.0.0:49190->8030/tcp, 0.0.0.0:49191->49707/tcp, 0.0.0.0:49192->8033/tcp, 0.0.0.0:49193->8042/tcp, 0.0.0.0:->/tcp kickass_galileo
发现上面的一个端口是49194对应虚拟机的50070端口。
这还不够,需要知道自己的boot2docker的ip是什么?默认是192.168.59.103
那么需要在自己的浏览器输入:http://192.168.59.103:49194/ 就会看见hadoop的运行状态了。
备注:
为什么下载github?
因为需要获取他的Dockerfile,好让docker知道它依赖docker-tez,然后在虚拟机执行下载和安装hive,内容如下:
FROM prasanthj/docker-tez:tez-0.5.2 #这是说明依赖什么,下面是安装命令
MAINTAINER Prasanth Jayachandran # to configure postgres as hive metastore backend
RUN apt-get update
RUN apt-get -yq install vim postgresql-9.3 libpostgresql-jdbc-java # having ADD commands will invalidate the cache forcing hive build from trunk everytime
# copy config, sql, data files to /opt/files
RUN mkdir /opt/files
ADD hive-site.xml /opt/files/
ADD hive-log4j.properties /opt/files/
ADD store_sales.* /opt/files/
ADD datagen.py /opt/files/ # clone and compile hive
ENV HIVE_VERSION 0.15.-SNAPSHOT
RUN cd /usr/local && git clone https://github.com/apache/hive.git #在天朝这可能被墙,所以速度非常慢
RUN cd /usr/local/hive && /usr/local/maven/bin/mvn clean install -DskipTests -Phadoop-,dist
RUN mkdir /usr/local/hive-dist && tar -xf /usr/local/hive/packaging/target/apache-hive-${HIVE_VERSION}-bin.tar.gz -C /usr/local/hive-dist # set hive environment
ENV HIVE_HOME /usr/local/hive-dist/apache-hive-${HIVE_VERSION}-bin
ENV HIVE_CONF $HIVE_HOME/conf
ENV PATH $HIVE_HOME/bin:$PATH
ADD hive-site.xml $HIVE_CONF/hive-site.xml
ADD hive-log4j.properties $HIVE_CONF/hive-log4j.properties # zookeeper pulls jline 0.9. and hive pulls jline2. This workaround is from HIVE-
RUN rm $HADOOP_PREFIX/share/hadoop/yarn/lib/jline-0.9..jar # add postgresql jdbc jar to classpath
RUN ln -s /usr/share/java/postgresql-jdbc4.jar $HIVE_HOME/lib/postgresql-jdbc4.jar # set permissions for hive bootstrap file
ADD hive-bootstrap.sh /etc/hive-bootstrap.sh
RUN chown root:root /etc/hive-bootstrap.sh
RUN chmod /etc/hive-bootstrap.sh # to avoid psql asking password, set PGPASSWORD
ENV PGPASSWORD hive
# 下面是安装postgresql,这个在国外很流行
# To overcome the bug in AUFS that denies postgres permission to read /etc/ssl/private/ssl-cert-snakeoil.key file.
# https://github.com/Painted-Fox/docker-postgresql/issues/30
# https://github.com/docker/docker/issues/783
# To avoid this issue lets disable ssl in postgres.conf. If we really need ssl to encrypt postgres connections we have to fix permissions to /etc/ssl/private directory everytime until AUFS fixes the issue
ENV POSTGRESQL_MAIN /var/lib/postgresql/9.3/main/
ENV POSTGRESQL_CONFIG_FILE $POSTGRESQL_MAIN/postgresql.conf
ENV POSTGRESQL_BIN /usr/lib/postgresql/9.3/bin/postgres
ADD postgresql.conf $POSTGRESQL_MAIN
RUN chown postgres:postgres $POSTGRESQL_CONFIG_FILE USER postgres
# create metastore db, hive user and assign privileges
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE DATABASE metastore;" &&\
psql --command "CREATE USER hive WITH PASSWORD 'hive';" && \
psql --command "ALTER USER hive WITH SUPERUSER;" && \
psql --command "GRANT ALL PRIVILEGES ON DATABASE metastore TO hive;" && \
cd $HIVE_HOME/scripts/metastore/upgrade/postgres/ &&\
psql -h localhost -U hive -d metastore -f hive-schema-0.15..postgres.sql # revert back to root user
USER root
参考:
https://github.com/prasanthj/docker-hive-on-tez
https://github.com/prasanthj/docker-hadoop
https://github.com/prasanthj/docker-tez
docker安装hive笔记的更多相关文章
- docker 安装Hive
转自:https://www.cnblogs.com/upupfeng/p/13452385.html#%E9%83%A8%E7%BD%B2hive 使用docker快速搭建hive环境 记录一下 ...
- docker安装小笔记
作者:邓聪聪 yum update Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker docker卸载旧版本(如 ...
- docker 安装 jenkins 笔记
前提: 已安装好 docker-ce,可运行 docker 命令 命令: sudo docker pull jenkins mkdir -p ~/dockers/jenkins cd ~/docker ...
- docker安装mysql笔记
首先 查找镜像 docker search mysql 拉取镜像 : docker pull mysql 拉取成功后,查看本地镜像: docker images 可以看到本地有两个镜像(redis是我 ...
- 2. Docker - 安装
一.Docker介绍 1. Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上, 也可以实现虚拟化. 容器时完全使用沙 ...
- HADOOP docker(四):安装hive
1.hive简介2.安装hive2.1 环境准备2.1.1 下载安装包2.1.2 设置hive用户的环境变量2.1.3 hive服务端配置文件2.1.4 hive客户端配置文件2.1.4 分发hive ...
- 【Linux】【自学笔记】Linux下面docker安装mysql
写在前面: 捣腾继续,之前把一个SpringBoot的程序安装在docker上面,参考链接:https://www.cnblogs.com/aki-stones/p/2019-11-01-note.h ...
- MongoDB学习笔记二:使用Docker安装MongoDB
目录 Docker安装MongoDB Docker给MongoDB设置用户密码 NoSQL Manager for MongoDB连接 为admin赋权限 上一个笔记介绍了Windows下安装Mong ...
- Docker笔记——Docker安装及制作镜像
1 Docker安装本文中Docker运行环境为Ubuntu 14.04.1 LTS 3.13.0-32-generic x64参考:https://docs.docker.com/v1.11/eng ...
随机推荐
- scanf的一个问题(暂未解决)
如下代码,没有按照预想的那样运行: int a; char b; printf("input a integer\n"); scanf("%d", &a ...
- hdu 2544 hdu 1874 poj 2387 Dijkstra 模板题
hdu 2544 求点1到点n的最短路 无向图 Sample Input2 1 //结点数 边数1 2 3 //u v w3 31 2 52 3 53 1 20 0 Sample Output32 ...
- hdu 5256 最少修改多少个数 能使原数列严格递增 (LIS)
Problem Description我们有一个数列A1,A2...An,你现在要求修改数量最少的元素,使得这个数列严格递增.其中无论是修改前还是修改后,每个元素都必须是整数. 请输出最少需要修改多少 ...
- java.lang.RuntimeException: Unable to get provider cn.jpush.android.service.DataProvider
转自:https://blog.csdn.net/u014306335/article/details/80355169 Android Studio 3.1.2 报错: java.lang.Runt ...
- openstack安装-计算节点-neutron服务安装
一.安装nettron相关服务 yum install openstack-neutron-linuxbridge ebtables ipset -y 二.快速配置配置 修改红色部分为计算节点的网卡 ...
- BZOJ5090 组题 BZOJ2017年11月月赛 二分答案 单调队列
欢迎访问~原文出处——博客园-zhouzhendong 去博客园看该题解 题目传送门 - BZOJ5090 11月月赛A题 题意概括 给出n个数. 求连续区间(长度大于等于k)最大平均值. 题解 这题 ...
- ACM笔记
写给自己看,纯属打发时间... Sacnf的返回值是成功赋值的变量个数 for(int i=0; i<100; i++) 在C++标准中指出for循环条件中定义的变量,作用域仅限于循环内部 ...
- 设计模式之Jdk动态代理
什么是动态代理呢?就是在java的运行过程中,动态的生成的代理类.(为了更熟悉的了解动态代理,你必须先熟悉代理模式,可点击设计模式之代理模式 阅读)我们知道java属于解释型语言,是在运行过程中,寻找 ...
- websphere 进程
websphere 监听的是8880端口, 一个server占用300M的内存. 1.查看进程号 >netstat -aon | findstr "8880" TCP 0.0 ...
- vue 百度地图实现标记多个maker,并点击任意一个maker弹出对应的提示框信息, (附: 通过多个地址,标记多个marker 的 方法思路)
通过点击不同筛选条件,筛选出不同企业所在的地点, 根据每个企业的经纬度 在地图上标记多个maker,点击任意一个maker,会弹出infoWindow 信息窗口: 说明: 因每个人写法不同.需求不同 ...