Looking at the akka cluster documentation , you need to know the server and port values ββwith at least 1 "seed node" to join the cluster. The application.conf example clearly states that the developer must know "host1" and "host2" when writing the file:
akka.cluster.seed-nodes = [
"akka.tcp://ClusterSystem@host1:2552",
"akka.tcp://ClusterSystem@host2:2552"]
But consider the possibility of registering each cluster node using the DNS load balancer. For example: you can create 10 nodes, all registered using the load balancer named "foobar.cluster.com", so the load balancer will send each new connection to one of 10 round node types.
Can I then set the seed-node to "akka.tcp://ClusterSystem@foobar.cluster.com:2552"
?
In other words, is it possible to use dynamic load balancing names to join akka cluster?
A priori, there is one potential problem: a node can get node as its seed on the first try. One possible solution to this problem is to add the same node seed value several times to the conf file to get a high probability of connecting to another node:
akka.cluster.seed-nodes = [
"akka.tcp://ClusterSystem@foobar.cluster.com:2552",
"akka.tcp://ClusterSystem@foobar.cluster.com:2552",
"akka.tcp://ClusterSystem@foobar.cluster.com:2552"]
But akka can simply reduce all of these values ββto a single call, since they are all the same ...
Thank you in advance for your consideration and response.
source
share