2
votes

I just came across Akka.net today, and it looks like a perfect fit for one of my projects. But I need kind of a zero-config cluster, where users just start up the app on multiple machines on their (local) network and they automatically form a cluster. I'm not sure if this is possible with Akka.net, as I wouldn't have seed nodes to put into the configuration file.

I guess, if there's an option to set seed nodes programmatically, I can broadcast to find other nodes, but it wouldn't really be guaranteed that all nodes start with the same set of seed nodes. Is it possible to start node A with seed node B, and node C with seed node A and so on?

1

1 Answers

3
votes

You can set cluster node from code using Cluster plugin i.e. Cluster.Get(Context.System).Join(nodeAddress). If you want to initialize a current node as a cluster seed, just order it to join to itself (cluster.SelfAddress).

In order to join any other node to a cluster, you just need to know address of at least one node, that is part of the cluster already. So yes you can join A ⇒ B and C ⇒ A in scenario descibed by you.