docker-compose快速部署flink1.18.1
目的
用于规范flink组件的部署操作,可用于开发测试环境快速部署
前置条件
基于centos7
实例名 | 内网IP | 主机名(Hostname) | 角色 |
---|---|---|---|
实例1 | 172.20.20.2 | test-20-2 | 节点1 |
开始部署
1.提前准备好flink:1.18.1镜像
docker pull flink:1.18.1
部署目录:
/app/funo/flink
2.docker-compose.yml容器编排文件如下:
version: "2.2"
services:
jobmanager:
image: registry.us-east-1.aliyuncs.com/oll/flink:1.18.1
expose:
- "6123"
ports:
- "48809:8081"
- "6123:6123"
command: jobmanager
volumes:
- ./job/artifacts:/opt/flink/usrlib
environment:
- TZ:Asia/Shanghai
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
parallelism.default: 4
privileged: true
taskmanager:
image: registry.us-east-1.aliyuncs.com/oll/flink:1.18.1
depends_on:
- jobmanager
command: taskmanager
expose:
- "6121"
- "6122"
scale: 2
volumes:
- ./job/artifacts:/opt/flink/usrlib
#- /app/funo/flink/conf:/opt/flink/conf:rw
environment:
- TZ:Asia/Shanghai
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager.numberOfTaskSlots: 4
parallelism.default: 4
privileged: true
3.配置目录赋权
chwon -R 9999.9999 /app/funo/flink/
4.启动命令:
docker-compose -f docker-compose.yaml up -d
docker-compose -f docker-compose.yaml ps
docker-compose -f docker-compose.yaml logs --tail=100 -f