Assume the picture below. Each Docker container belongs to a single Akka cluster "foo", and each container has runs one cluster node. The IP address assigned by Docker (inside the container) is given in green. All the internal ports are 9090 but are mapped to various external ports on the host.
What is the Akka URI for the node in say Docker 5? Would it be akka.tcp://[email protected]:9101
I've read some blogs on Akka and Docker that involve linking but this doesn't seem workable (?) for a multi-node deployment and I'm not sure how linking scales to 100s of nodes.
I need some way for Akka to know the address of its cluster. Left to its own devices, Docker 5 might decide it's reachable at akka.tcp://[email protected]:9090, which is useless/unreachable outside of its own container.
At this point I'm thinking I pass the host's IP and port (e.g. 10.0.0.195:9101) to the Docker container as a parameter on start-up for Akka to use when it configures itself.
Would this work, or is there a better way to go?
Indeed! New Akka (snapshot at time of posting) does have nifty new binds that solve this problem. Example of use here: https://github.com/gzoller/docker-exp/tree/cluster
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With