'Connection refused for Flink with docker-compose
I have the following docker-compose file which is a copy of the docker-compose from the docker apache flink site. The only difference is that I am using the Mac m1 version.
version: "2.2"
services:
jobmanager:
image: arm64v8/flink:alpine
ports:
- "8081:8081"
command: standalone-job --job-classname com.job.ClassName [--job-id <job id>] [--fromSavepoint /path/to/savepoint [--allowNonRestoredState]] [job arguments]
volumes:
- ~/sg_flink/artifacts:/opt/flink/usrlib
networks:
- flink-network
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
parallelism.default: 2
taskmanager:
image: arm64v8/flink:alpine
depends_on:
- jobmanager
command: taskmanager
scale: 1
volumes:
- ~/sg_flink/artifacts:/opt/flink/usrlib
networks:
- flink-network
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager.numberOfTaskSlots: 2
parallelism.default: 2
networks:
flink-network:
The error is a connection is refused
taskmanager_1 | 2021-11-03 17:43:02,724 INFO org.apache.flink.runtime.taskexecutor.TaskExecutor - Could not resolve ResourceManager address akka.tcp://flink@9cf35ea13c8b:6123/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@9cf35ea13c8b:6123/user/resourcemanager..
taskmanager_1 | 2021-11-03 17:43:12,753 WARN akka.remote.transport.netty.NettyTransport - Remote connection to [null] failed with java.net.ConnectException: Connection refused: 9cf35ea13c8b/172.20.0.3:6123
taskmanager_1 | 2021-11-03 17:43:12,756 WARN akka.remote.ReliableDeliverySupervisor - Association with remote system [akka.tcp://flink@9cf35ea13c8b:6123] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@9cf35ea13c8b:6123]] Caused by: [Connection refused: 9cf35ea13c8b/172.20.0.3:6123]
taskmanager_1 | 2021-11-03 17:43:12,758 INFO org.apache.flink.runtime.taskexecutor.TaskExecutor - Could not resolve ResourceManager address akka.tcp://flink@9cf35ea13c8b:6123/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@9cf35ea13c8b:6123/user/resourcemanager..
docker ps output looks like this
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4416f88f60c2 arm64v8/flink:alpine "/docker-entrypoint.…" 44 seconds ago Up 44 seconds 6123/tcp, 8081/tcp sg_flink_taskmanager_1
c211940acf41 arm64v8/flink:alpine "/docker-entrypoint.…" 45 seconds ago Up 44 seconds 6123/tcp, 0.0.0.0:8081->8081/tcp sg_flink_jobmanager_1
```
Solution 1:[1]
I have met this trouble in same condittion,and I fixed it use docker-compse links.
taskmanager:
links:
- jobmanager
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | soccerlover |
