Connection error while joining to seed - nodes

Hi,

I have two nodes in my seed node list

seed-nodes = [ "akka.tcp://ReactorCluster@127.0.0.1:4001", 
"akka.tcp://ReactorCluster@127.0.0.1:4002" ]

If I start node on port 4001 followed by 4002 it is joining to the cluster successfully.

But If I start node on port 4002 then it is not joining to the cluster and it is throwing the below warnings

[WARN] [07/31/2019 19:01:46.607] [New I/O boss #3] [NettyTransport(akka://ReactorCluster)] Remote connection to [null] failed with java.net.ConnectException: Connection refused: /127.0.0.1:4001
[WARN] [07/31/2019 19:01:46.607] [ReactorCluster-akka.remote.default-remote-dispatcher-6] [akka.tcp://ReactorCluster@127.0.0.1:4002/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FReactorCluster%40127.0.0.1%3A4001-0] Association with remote system [akka.tcp://ReactorCluster@127.0.0.1:4001] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://ReactorCluster@127.0.0.1:4001]] Caused by: [java.net.ConnectException: Connection refused: /127.0.0.1:4001]
[INFO] [07/31/2019 19:01:46.608] [ReactorCluster-akka.actor.default-dispatcher-21] [akka://ReactorCluster/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://ReactorCluster/system/cluster/core/daemon/joinSeedNodeProcess-2#705042394] to Actor[akka://ReactorCluster/deadLetters] was not delivered. [3] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ReactorCluster/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[WARN] [07/31/2019 19:01:51.616] [ReactorCluster-akka.actor.default-dispatcher-16] [akka.cluster.Cluster(akka://ReactorCluster)] Cluster Node [akka.tcp://ReactorCluster@127.0.0.1:4002] - Couldn't join seed nodes after [2] attempts, will try again. seed-nodes=[akka.tcp://ReactorCluster@127.0.0.1:4001]
[INFO] [07/31/2019 19:01:51.620] [ReactorCluster-akka.actor.default-dispatcher-16] [akka://ReactorCluster/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin] from Actor[akka://ReactorCluster/system/cluster/core/daemon/joinSeedNodeProcess-2#705042394] to Actor[akka://ReactorCluster/deadLetters] was not delivered. [4] dead letters encountered. If this is not an expected behavior, then [Actor[akka://ReactorCluster/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[WARN] [07/31/2019 19:01:56.636] [ReactorCluster-akka.actor.default-dispatcher-22] [akka.cluster.Cluster(akka://ReactorCluster)] Cluster Node [akka.tcp://ReactorCluster@127.0.0.1:4002] - Couldn't join seed nodes after [3] attempts, will try again. seed-nodes=[akka.tcp://ReactorCluster@127.0.0.1:4001]

Kindly guide me on this !!

The first node in the list is special and is the cluster node that will join itself to create the initial cluster, so before you have started the cluster the first time, it is impossible for only the 4002 node to join a cluster.

When you have done that initial bootstrap, it is possible to stop 4001 and start it again without causing a new cluster to be created, it will first try to join a cluster through the node 4002 and only if there is no such node will it join itself.