I have a PlayFramework (play-scala) application that I want to run in a cluster. So I might have several docker containers of this application image running. I don't know the IP addresses of these ahead of time, as the cloud services provider can start and stop them dynamically,so I cannot specify seed nodes. Also, all of the application.conf
files should be the same fore each instance of the application?
How do I configure the play application to enable each instance of the application to discover and join the Akka cluster?
I have looked at: https://www.playframework.com/documentation/2.7.x/ScalaAkka#Akka-Cluster Akka cluster setup with play framework https://github.com/lregnier/play-akka-cluster-aws
Do I have to use Akka Cluster Bootstrap since I cannot specify seed nodes?
Is it enough to have the following in the application.conf
file (taken from Cluster Usage:
akka {
actor {
provider = "cluster"
}
remote {
log-remote-lifecycle-events = off
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551",
"akka.tcp://[email protected]:2552"]
# auto downing is NOT safe for production deployments.
# you may want to use it during development, read more about it in the docs.
#
# auto-down-unreachable-after = 10s
}
}
But without the seed nodes? If so, how do node discover and join the cluster?