Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Akka Cluster Joining with DNS Load Balancing

Looking at the akka cluster documentation it appears that you have to know the server & port values of at least 1 "seed node" to join the cluster. The example application.conf clearly indicates that the developer needs to 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 with a DNS load balancer. For example: it is possible to instantiate 10 nodes that are all registered with a load balancer behind the name "foobar.cluster.com" such that the load balancer will send each new connection to one of the 10 nodes round-robin style.

Could 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 an akka cluster?

A priori there is one potential issue: a node may get itself as the seed node on the first try. One potential solution to this issue is putting the same seed node value multiple times in the conf file to get a high probability of eventually connecting to a different 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 may just reduce all of those values to a single call since they are all exactly the same...

Thank you in advance for your consideration and response.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It is possible, but you have to do the DNS resolution yourself, and then join the cluster programmatically. This is somewhat described here: http://doc.akka.io/docs/akka/current/scala/cluster-usage.html#Joining_to_Seed_Nodes

So you would first need your configuration file to contain akka.cluster.seed-nodes = [] in order to disable auto joining.

Then you would need to resolve foobar.cluster.com to get a list of actual nodes i.e., 01.foobar.cluster.com, 02.foobar.cluster.com, ...

You would use those to join the cluster: Cluster(system).joinSeedNodes(_list_of_nodes_with_port).

Finally, remember that when the hostname and port pair that Akka binds to will be different than the "logical" host name and port pair that is used to connect to the system from the outside. This requires special configuration

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!