採取官方示例akka-sample-cluster-java用於演示:
1.首先,啓動其也是種子節點分別重新啓動所有後端節點後,akka前端節點如何連接到羣集?
sbt 'runMain sample.cluster.factorial.FactorialBackendMain 2551'
sbt 'runMain sample.cluster.factorial.FactorialBackendMain 2551'
一切都應該罰款前端節點
sbt 'runMain sample.cluster.factorial.FactorialFrontendMain'
2.開始絲束後端節點現在。
[info] [INFO] [05/11/2017 17:40:42.822] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:2551] - Node
[akka.tcp://[email protected]:2552] is JOINING, roles [backend]
[info] [INFO] [05/11/2017 17:40:43.349] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:2551] - Leader is moving node
[akka.tcp://[email protected]:2551] to [Up]
[info] [INFO] [05/11/2017 17:40:43.349] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:2551] - Leader is moving node
[akka.tcp://[email protected]:2552] to [Up]
[info] [INFO] [05/11/2017 17:40:43.349] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:2551] - Leader is moving node
[akka.tcp://[email protected]:56431] to [Up]
然而,當我擋住了兩個後端節點(按Ctrl + C),並再次重新啓動它們,無論是後端節點的狀態始終是「加盟」,並且不能被改爲「向上」。
[info] [INFO] [05/11/2017 17:39:32.356] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://[email protected]:2551] - Node [akka.tcp://[email protected]:2551] is JOINING, roles [backend]
[info] [INFO] [05/11/2017 17:39:35.637] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:2551] - Node
[akka.tcp://[email protected]:56431] is JOINING, roles [frontend]
前端節點如何在不重新啓動前端節點的情況下自動加入種子節點?它在重新啓動前端節點時起作用。
讚賞您的答案! –