Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda