【发布时间】:2025-12-22 11:35:06
【问题描述】:
以官方示例akka-sample-cluster-java进行演示:
1.首先,启动前端节点
sbt 'runMain sample.cluster.factorial.FactorialFrontendMain'
2。分别启动两个也是种子节点的后端节点
sbt 'runMain sample.cluster.factorial.FactorialBackendMain 2551'
sbt 'runMain sample.cluster.factorial.FactorialBackendMain 2551'
现在一切都应该没问题。
[info] [INFO] [05/11/2017 17:40:42.822] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Node
[akka.tcp://ClusterSystem@127.0.0.1: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://ClusterSystem@127.0.0.1:2551] - Leader is moving node
[akka.tcp://ClusterSystem@127.0.0.1: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://ClusterSystem@127.0.0.1:2551] - Leader is moving node
[akka.tcp://ClusterSystem@127.0.0.1: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://ClusterSystem@127.0.0.1:2551] - Leader is moving node
[akka.tcp://ClusterSystem@127.0.0.1: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://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1: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://ClusterSystem@127.0.0.1:2551] - Node
[akka.tcp://ClusterSystem@127.0.0.1:56431] is JOINING, roles [frontend]
前端节点如何在不重启前端节点的情况下自动加入种子节点?它在重新启动前端节点时起作用。
【问题讨论】:
标签: akka cluster-computing frontend backend seed