version: "2.1"
services:
jobmanager:
image: flink
expose:
- "6123"
ports:
- "8081:8081"
command: jobmanager
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
- TZ=Asia/Shanghai
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '2'
memory: 2G
taskmanager:
image: flink
expose:
- "6121"
- "6122"
depends_on:
- jobmanager
command: taskmanager
links:
- "jobmanager:jobmanager"
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
- TZ=Asia/Shanghai
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '2'
memory: 2G
taskmanager2:
image: flink
expose:
- "6121"
- "6122"
depends_on:
- jobmanager
command: taskmanager
links:
- "jobmanager:jobmanager"
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
- TZ=Asia/Shanghai
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '2'
memory: 2G
执行资源限制: docker-compose --compatibility up -d