Dedicated seed node for cluster bootstrap

akka-management
akka-cluster

(Dmitriy Zakomirnyi) #1

Hello!

I need architectural advise regarding cluster bootstrap in dynamic environment, Docker Swarm to be precise.

I have a cluster that bootstraps by means of Akka Management Cluster Bootstrap using akka-dns as a discovery method.

Is it ok that all nodes have exactly one service-name specified in contact-point-discovery section?
Here is the configuration:

management.cluster.bootstrap.contact-point-discovery {
   service-name = "tasks.service1"
   port-name = ""
   protocol = ""
   required-contact-point-nr = 1
}

I tried to cross-reference, that is service1 would have the following configuration:

management.cluster.bootstrap.contact-point-discovery {
    service-name = "tasks.service2"
    port-name = ""
    protocol = ""
    required-contact-point-nr = 1
  }

and service2:

management.cluster.bootstrap.contact-point-discovery {
    service-name = "tasks.service1"
    port-name = ""
    protocol = ""
    required-contact-point-nr = 1
  }

but it ends up in multiple separate clusters with only one node in each.

My second question is more about delivery complexity.
Lets assume I have multiple environment to deliver to (env1, env2, …, envN, etc. ).
Each env has it’s own list of services that have to be running on that env.
If I have exactly one contact-point-discovery service-name specified in each cluster service, soon or later I will end up in a situation when I have to deliver that service to each environment, which doesn’t sound to me as a good idea.
Perhaps it’s better to have a dedicated service with sole purpose is to be the seed node?


(Christopher Batey) #2

The discovery mechanism is expected to return multiple targets for that service name, ideally all your potential cluster members. In the case of DNS that would be an SRV record with multiple targets or DNS returning multiple A/AAAA records.

If you just want to hard code a seed then you don’t need boostrap and can just use seed-nodes as described in the docs here: https://doc.akka.io/docs/akka/2.5/cluster-usage.html#a-simple-cluster-example