Reputation: 2644
I have an application where I cannot know the seed nodes ahead of time to put into the application configuration. Therefore, the application starts on one node and when it's started on the other nodes, they use Cluster.join to join the cluster on the first node. The problem is that the join never completes and the cluster never starts. What is the problem?
Upvotes: 1
Views: 826
Reputation: 2644
The problem is that there is no cluster yet to join. Simply instantiating a cluster object on the first node does not initiate the cluster. There is a small note in the documentation that may be easily missed:
Joining can also be performed programatically with Cluster(system).join. Note that you can only join to an existing cluster member, which means that for bootstrapping some node must join itself.
So, the first node should join itself to initiate the cluster. This causes the creation of a "leader" that is responsible for adding and removing nodes from the cluster.
Upvotes: 5