Hi Eugene

The order of the seed nodes in the list is important, since the first one
is important in the bootstrapping process:

http://doc.akka.io/docs/akka/2.3.4/scala/cluster-usage.html#Joining_to_Seed_Nodes
"[...] the node configured as the first element in the seed-nodes
configuration list must be started when initially starting a cluster,
otherwise the other seed-nodes will not become initialized and no other
node can join the cluster. The reason for the special first seed node is to
avoid forming separated islands when starting from an empty cluster."

So you should have the same node as the first one in the seed node list on
both machines.

If you have the proper order, after initial startup you can restart any of
the nodes. You said that you have a problem even in this case, can you post
some log snippets to show what happens in that case?

Btw, you get an InitJoinNack if you try to join a member to a node that has
been not fully initialized yet. Are you sure you are restarting the first
node after the second has been fully initialized?

-Endre


On Tue, Jul 22, 2014 at 4:55 AM, Eugene Dzhurinsky <jdeve...@gmail.com>
wrote:

> Hello!
>
> I have a cluster with 2 nodes, with the addresses 10.9.0.1 and 10.9.0.2
>
> the appropriate Akka configurations are:
>
> akka {
>     remote {
>         netty.tcp {
>             hostname = "10.9.0.1"
>             port = 2551
>         }
>     }
>
>     cluster {
>         seed-nodes = [
>           "akka.tcp://HttpCluster@10.9.0.2:2551",
>           "akka.tcp://HttpCluster@10.9.0.1:2551"
>         ]
>     }
>
> }
>
> and
>
> akka {
>   remote {
>     netty.tcp {
>       hostname = "10.9.0.2"
>       port = 2551
>     }
>   }
>
>   cluster {
>     seed-nodes = [
>      "akka.tcp://HttpCluster@10.9.0.1:2551",
>      "akka.tcp://HttpCluster@10.9.0.2:2551"
>    ]
>
>   }
> }
>
> So each node tries to connect to another one and then falls back to
> connection to itself (the order of seed-nodes is inverted). I theory (I
> assumed so) the cluster should survive the case when either of the nodes is
> restarted, so the node can re-join the custer.
>
> However this doesn't work. In the logs I can see:
>
> INFO   | jvm 1    | 2014/07/21 22:37:45 | 2014-07-21 22:37:45,525 DEBUG
> [EndpointWriter] sending message RemoteMessage:
> [ActorSelectionMessage(InitJoin,Vector(system, cluster, core, daemon))] to
> [Actor[akka.tcp://HttpCluster@10.9.0.2:2551/]
> <http://HttpCluster@10.9.0.2:2551/%5D>]<+[akka.tcp://
> HttpCluster@10.9.0.2:2551/] from
> [Actor[akka://HttpCluster/system/cluster/core/daemon/joinSeedNodeProcess-1#-625930305]]
>
> INFO   | jvm 1    | 2014/07/21 22:37:45 | 2014-07-21 22:37:45,571 DEBUG
> [EndpointWriter] received local message RemoteMessage:
> [InitJoinNack(akka.tcp://HttpCluster@10.9.0.2:2551)] to
> [Actor[akka://HttpCluster/system/cluster/core/daemon/joinSeedNodeProcess-1#-625930305]]<+[akka://HttpCluster/system/cluster/core/daemon/joinSeedNodeProcess-1]
> from [Actor[akka.tcp://
> HttpCluster@10.9.0.2:2551/system/cluster/core/daemon#1007710386]()]
> INFO   | jvm 1    | 2014/07/21 22:37:45 | 2014-07-21 22:37:45,907 DEBUG
> [EndpointWriter] received local message RemoteMessage:
> [ActorSelectionMessage(InitJoin,Vector(system, cluster, core, daemon))] to
> [Actor[akka://HttpCluster/]]<+[akka://HttpCluster/] from [Actor[akka.tcp://
> HttpCluster@10.9.0.2:2551/system/cluster/core/daemon/joinSeedNodeProcess-1#400123135]()]
>
> INFO   | jvm 1    | 2014/07/21 22:37:45 | 2014-07-21 22:37:45,908 DEBUG
> [EndpointWriter] sending message RemoteMessage: [InitJoinNack(akka.tcp://
> HttpCluster@10.9.0.1:2551)] to [Actor[akka.tcp://
> HttpCluster@10.9.0.2:2551/system/cluster/core/daemon/joinSeedNodeProcess-1#400123135]
> ]<+[akka.tcp://
> HttpCluster@10.9.0.2:2551/system/cluster/core/daemon/joinSeedNodeProcess-1]
> from [Actor[akka://HttpCluster/system/cluster/core/daemon#-1453271007]]
>
> on both of the nodes. I have no ide what those InitJoinNack means, but I
> guess its "not acknowledged".
>
> The JMX console shows:
>
> #mbean = akka:type=Cluster:
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.2:2551",
>   "members": [
>
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
> and
>
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>   "members": [
>
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
> respectively on the nodes.
>
> If I change the order ot seed nodes on 10.9.0.1 to
>     seed-nodes = [
>      "akka.tcp://HttpCluster@10.9.0.1:2551",
>      "akka.tcp://HttpCluster@10.9.0.2:2551"
>    ]
>
>
> then start the node 10.9.0.1 first and 10.9.0.2 second, everything works
> as expected: JMX shows:
>
> #mbean = akka:type=Cluster:
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>   "members": [
>     {
>       "address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>       "status": "Up"
>     }
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
>  after the first node is started, and
>
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>   "members": [
>     {
>       "address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>       "status": "Up"
>     },
>     {
>       "address": "akka.tcp://HttpCluster@10.9.0.2:2551",
>       "status": "Up"
>     }
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
> after the second node is started.
>
> So far so good, however if the node 10.9.0.1 is restarted - then neither
> node 10.9.0.2 knows about 10.9.0.1, nor 10.9.0.1 knows about 10.9.0.2,
> which is reflected in JMX console
>
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.2:2551",
>   "members": [
>     {
>       "address": "akka.tcp://HttpCluster@10.9.0.2:2551",
>       "status": "Up"
>     }
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
> and
>
> ClusterStatus = {
>   "self-address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>   "members": [
>     {
>       "address": "akka.tcp://HttpCluster@10.9.0.1:2551",
>       "status": "Up"
>     }
>   ],
>   "unreachable": [
>
>   ]
> }
> ;
>
> At this point I have no idea how to ensure that the cluster is always in
> consistent state. Perhaps I'm missing something?
>
> Please advice.
>
> Thanks!
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to