docker/hive/README.md
2018-07-29 14:05:41 +08:00

69 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# hive docker 服务搭建
## 创建镜像
镜像构建源码请[参考](http://git.yangyufans.com/pub/docker/tree/master/hive)
## 版本说明
3.0.0-3.1.0对应hive和hadoop相应版本
- 3.0.0 为hive版本
- 3.1.0 为hadoop版本
```bash
docker build -t ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0 .
```
## 从远程拉取镜像
```bash
docker pull ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0
```
## 创建镜像
```bash
docker run -d \
--privileged=true \
-p 12580:22 \
-p 9870:9870 \
-p 50070:50070 \
-p 8020:8020 \
-p 8088:8088 \
-p 8042:8042 \
-v $PWD/conf:/conf \
-v $PWD/data:/data \
-v $PWD/logs:/logs \
--name hadoop \
ccr.ccs.tencentyun.com/yy-dk/hive:3.0.0
```
> conf:配置文件,若自己修改完配置文件放在本目录,会自动覆盖
> data:数据目录
> logs:日志文件目录
## 进入容器
```bash
ssh -p 12580 root@localhost
```
- 密码123456
## 格式化namenode
```bash
hdfs namenode -format
```
## 启动
```bash
start-all.sh
```
## 初始化元数据
```bash
schematool -dbType derby -initSchema
```
## 启动hive
```bash
hive
```