1. 容器部署
本文介绍如何在容器上部署HENGSHI SENSE,以及部署后如何进行版本升级和数据备份。
1.1. 部署前准备工作
单机部署前,请完成如下准备工作。
1.检查docker的环境。需要满足
- Docker版本 >= 17.09
- 安装docker-compose。
2.获取并导入离线镜像。
wget https://download.hengshi.com/releases/hengshi-sense-xxx.tar.gz
docker load -i hengshi-sense-xxx.tar.gz
3.根据版本获取docker-compose部署文件。
安装版本 | 部署文件 | 组件依赖 |
---|---|---|
3.x | docker-compose | metadb、engine、hengshi |
4.0.x | docker-compose | metadb、engine、hengshi、minio |
4.1.x | docker-compose | metadb、engine、hengshi、minio、redis、flink |
4.2.x | docker-compose | metadb、engine、hengshi、minio、redis、flink |
4.3.x | docker-compose | metadb、engine、hengshi、minio、redis、flink |
4.4.x | docker-compose | metadb、engine、hengshi、minio、redis、flink |
4.5.0 ~ 4.5.6 | docker-compose | metadb、engine、hengshi、minio、redis、flink |
4.5.7 ~ 4.5.x(x>7) | docker-compose | metadb、engine、hengshi、minio、redis、flink、apm-server |
1.2. 单机部署
请按下面的操作提示进行单机部署HENGSHI服务。
1.初始化metadb和引擎
unzip -q docker-compose-x.x.x.zip # 将下载的docker-compose文件解压
cd docker-compose-x.x.x # 进入配置文件目录
cp hsenv .env # 修改.env中的变量, HS_IMAGE_TAG必须修改为导入的离线镜像的tag 详细变量可参考文档底部示例;
# 安装前务必先做metadb和引擎的初始化操作,否则hengshi无法启动
docker-compose run --rm metadb init metadb # 初始化 metadb
docker-compose run --rm engine init engine # 初始化 engine
运行正常会出现如下提示。
unzip -q docker-compose-x.x.x.zip
cd docker-compose-x.x.x
cp hsenv .env
docker-compose run --rm metadb init metadb
# 日志中出现以下字样 则表示metadb初始化成功
INIT SUCCESS! : [metadb] /opt/hsdata/pg_data
docker-compose run --rm engine init engine
# 日志中出现以下字样 则表示engine初始化成功
INIT SUCCESS! : [engine] /opt/hsdata/engine-cluster
after config docker engine standalone
2.启动服务
docker-compose up -d # detach 方式启动
运行正常会出现如下提示。
docker-compose up -d
[+] Running 8/8
✔ Container hengshi-flink Started 1.1s
✔ Container hengshi-metadb Started 1.1s
✔ Container hengshi-engine Started 1.0s
✔ Container hengshi-apmserver Started 0.8s
✔ Container hengshi-minio Started 1.0s
✔ Container hengshi-monit Started 1.0s
✔ Container hengshi-redis Started 1.2s
✔ Container hengshi-sense Started 1.9s
3.停止服务并删掉容器
docker-compose down # 销毁容器
运行正常会出现如下提示。
docker-compose down
[+] Running 9/8
✔ Container hengshi-monit Removed 0.0s
✔ Container hengshi-apmserver Removed 0.0s
✔ Container hengshi-engine Removed 10.4s
✔ Container hengshi-sense Removed 0.0s
✔ Container hengshi-flink Removed 10.3s
✔ Container hengshi-metadb Removed 10.4s
✔ Container hengshi-minio Removed 10.4s
✔ Container hengshi-redis Removed 10.2s
✔ Network hengshi_default Removed 0.1s
4.暂停服务
docker-compose stop # 停止容器服务
运行正常会出现如下提示。
docker-compose stop
[+] Running 8/8
✔ Container hengshi-monit Stopped 0.0s
✔ Container hengshi-sense Stopped 0.0s
✔ Container hengshi-apmserver Stopped 0.0s
✔ Container hengshi-engine Stopped 10.6s
✔ Container hengshi-minio Stopped 10.5s
✔ Container hengshi-flink Stopped 10.4s
✔ Container hengshi-metadb Stopped 10.4s
✔ Container hengshi-redis Stopped 10.5s
5.启动暂停的服务
docker-compose start # 启用暂停的容器
运行正常会出现如下提示。
docker-compose start
[+] Running 8/8
✔ Container hengshi-flink Started 1.2s
✔ Container hengshi-metadb Started 0.9s
✔ Container hengshi-apmserver Started 1.0s
✔ Container hengshi-redis Started 1.0s
✔ Container hengshi-engine Started 0.9s
✔ Container hengshi-monit Started 1.2s
✔ Container hengshi-minio Started 0.8s
✔ Container hengshi-sense Started 0.7s
示例: .env文件
#hengshi-sense 镜像的 tag 版本
HS_IMAGE_TAG=$TAG
#可选, 配置volumn的根路径,默认为docker-compose.yaml目录下。可以选择配置。请规划数据盘,建议配置最大数据盘。
HSHOME=.
# hengshi web service port
HS_HENGSHI_EXPOSE_PORT=8080
# hengshi data-gateway service port
DATA_GATEWAY_PUBLIC_EXPOSE_PORT=8079
#可选, 容器对外暴露的 metadb 端口, 默认54320
HS_PG_EXPOSE_PORT=54320
# 可选,engine 类型 可选项 greenplum|doris
HS_ENGINE_TYPE=greenplum
# 可选, engine 类型为 greenplum, engine对外暴露的 端口
HS_ENGINE_EXPOSE_PORT=15432
# 可选, engine 类型为 doris, engine对外暴露的 端口
#HS_ENGINE_EXPOSE_PORT=9030
# remote debug port
HS_JDWP_EXPOSE_PORT=5005
# 可选,MINIO 服务暴露端口
HS_MINIO_EXPOSE_PORT=9891
# 可选,MINIO 控制台对外暴露端口
HS_MINIO_CONSOLE_EXPOSE_PORT=9892
# 可选,redis 服务暴露端口
HS_REDIS_EXPOSE_PORT=6379
# 可选,flink 服务暴露端口
HS_FLINK_EXPOSE_PORT=8082
# 可选,apmserver 服务暴露端口
HS_APMSERVER_EXPOSE_PORT=8200
# MINIO连接地址|登陆用户|登陆密钥
MINIO_SERVER_HOST=hengshi-minio
MINIO_ROOT_USER=hengshi
MINIO_ROOT_PASSWORD=hengshi202020
说明:
配置.env时请确保配置的端口没有被占用,可以执行netstat -anpt命令进行查询。 如内置引擎类型要求为Doris,调整HS_ENGINE_TYPE参数
results matching ""
No results matching ""
衡石文档
- 产品功能一览
- 发布说明
- 新手上路
- 安装与启动
- 系统管理员手册
- 数据管理员手册
- 分析人员手册
- 数据查看员手册
- 数据服务
- 最佳实践
- 衡石分析平台 API 手册
- 附录