当前位置: 首页 > 知识库问答 >
问题:

Akka集群不工作

伊裕
2023-03-14

我试图学习Akka集群下面的教程提供了这里

我已经创建了应用程序和回购是在这里。

正如教程中提到的,我已经启动了FrontEndApp

> runMain TransformationFrontendApp
[info] Running TransformationFrontendApp 
[INFO] [10/31/2017 17:28:05.293] [run-main-0] [akka.remote.Remoting] Starting remoting
[INFO] [10/31/2017 17:28:05.543] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@localhost:54746]
[INFO] [10/31/2017 17:28:05.556] [run-main-0] 
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node 
[akka.tcp://ClusterSystem@localhost:54746] - Starting up...
[INFO] [10/31/2017 17:28:05.648] [run-main-0] 
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node 
[akka.tcp://ClusterSystem@localhost:54746] - Registered cluster JMX MBean 
[akka:type=Cluster]
[INFO] [10/31/2017 17:28:05.648] [run-main-0] 
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node 
[akka.tcp://ClusterSystem@localhost:54746] - Started up successfully
[WARN] [10/31/2017 17:28:05.683] [ClusterSystem-akka.actor.default-dispatcher-2] 
[WARN] [10/31/2017 17:28:05.748] [New I/O boss #3] 
[NettyTransport(akka://ClusterSystem)] Remote connection to [null] failed with java.net.ConnectException: Connection refused: /127.0.0.1:2551
[WARN] [10/31/2017 17:28:05.750] [New I/O boss #3] 
[NettyTransport(akka://ClusterSystem)] Remote connection to [null] failed with java.net.ConnectException: Connection refused: /127.0.0.1:2552
[WARN] [10/31/2017 17:28:05.751] [ClusterSystem-akka.remote.default-remote-dispatcher-12]        [akka.tcp://ClusterSystem@localhost:54746/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-0] Association with remote system [akka.tcp://ClusterSystem@127.0.0.1:2551] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://ClusterSystem@127.0.0.1:2551]] Caused by: [Connection refused: /127.0.0.1:2551]  

即使我在2551和2552上启动后端应用程序,上述警告消息也会不断重复。

在2551上启动后端参与者的终端日志。

> runMain TransformationBackendApp 2551
[info] Running TransformationBackendApp 2551
[INFO] [10/31/2017 17:28:50.867] [run-main-0] [akka.remote.Remoting] Starting remoting
[INFO] [10/31/2017 17:28:51.122] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@localhost:2551]
[INFO] [10/31/2017 17:28:51.134] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2551] - Starting up...
[INFO] [10/31/2017 17:28:51.228] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2551] - Registered cluster JMX MBean [akka:type=Cluster]
[INFO] [10/31/2017 17:28:51.228] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2551] - Started up successfully
[WARN] [10/31/2017 17:28:51.259] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.tcp://ClusterSystem@localhost:2551/system/cluster/core/daemon/downingProvider] Don't use auto-down feature of Akka Cluster in production. See 'Auto-downing (DO NOT USE)' section of Akka Cluster documentation.
[   ERROR] [10/31/2017 17:28:51.382] [ClusterSystem-akka.remote.default-remote-dispatcher-5] [akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40localhost%3A2551-2/endpointWriter] dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Actor[akka.tcp://ClusterSystem@127.0.0.1:2551/]] arriving at [akka.tcp://ClusterSystem@127.0.0.1:2551] inbound addresses are [akka.tcp://ClusterSystem@localhost:2551]

最后一个[错误]日志持续重复。

在2552上启动后端参与者的终端日志。

> runMain TransformationBackendApp 2552
[info] Running TransformationBackendApp 2552
[INFO] [10/31/2017 17:28:25.451] [run-main-0] [akka.remote.Remoting] Starting remoting
[INFO] [10/31/2017 17:28:25.689] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@localhost:2552]
[INFO] [10/31/2017 17:28:25.706] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2552] - Starting up...
[INFO] [10/31/2017 17:28:25.803] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2552] - Registered cluster JMX MBean [akka:type=Cluster]
[INFO] [10/31/2017 17:28:25.803] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@localhost:2552] - Started up successfully
[WARN] [10/31/2017 17:28:25.836] [ClusterSystem-akka.actor.default-dispatcher-2] [akka.tcp://ClusterSystem@localhost:2552/system/cluster/core/daemon/downingProvider] Don't use auto-down feature of Akka Cluster in production. See 'Auto-downing (DO NOT USE)' section of Akka Cluster documentation.
[WARN] [10/31/2017 17:28:25.909] [New I/O boss #3] [NettyTransport(akka://ClusterSystem)] Remote connection to [null] failed with java.net.ConnectException: Connection refused: /127.0.0.1:2551
[WARN] [10/31/2017 17:28:25.910] [ClusterSystem-akka.remote.default-remote-dispatcher-13] [akka.tcp://ClusterSystem@localhost:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-0] Association with remote system [akka.tcp://ClusterSystem@127.0.0.1:2551] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://ClusterSystem@127.0.0.1:2551]] Caused by: [Connection refused: /127.0.0.1:2551]
[INFO] [10/31/2017 17:28:25.914] [ClusterSystem-akka.actor.default-dispatcher-4] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#-937368711] to Actor[akka://ClusterSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[ERROR] [10/31/2017 17:28:25.958] [ClusterSystem-akka.remote.default-remote-dispatcher-17] [akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40localhost%3A2552-2/endpointWriter] dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Actor[akka.tcp://ClusterSystem@127.0.0.1:2552/]] arriving at [akka.tcp://ClusterSystem@127.0.0.1:2552] inbound addresses are [akka.tcp://ClusterSystem@localhost:2552]

不确定是什么原因后端群集节点不能检测到彼此和前端参与者节点与后端。

我会错过任何设置吗?

共有1个答案

年良骏
2023-03-14

问题出在您的应用程序中。你有阿克卡。遥远的内蒂。tcp。hostname=“localhost”和akka。簇种子节点=[“akka。tcp://ClusterSystem@127.0.0.1:2551“阿克卡。tcp://ClusterSystem@127.0.0.1:2552“])。您必须使用localhost或127.0.0.1,而不是两者都使用:

akka {

  actor {
    provider = "akka.cluster.ClusterActorRefProvider"
  }

  remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "localhost"
      port = 0
    }
  }

  cluster {
    seed-nodes = ["akka.tcp://ClusterSystem@localhost:2551", "akka.tcp://ClusterSystem@localhost:2552"]
    auto-down-unreachable-after = 10s
  }

}
 类似资料:
  • 下面是Broker.xml中artemis集群(3台服务器)的设置 我预计broker3在集群中就应该开始接收请求。

  • 我一直在通过Akka示例集群应用程序教程和本文档研究Akka集群。我让它在本地运行(127.0.0.1),但我似乎无法使用我的静态IP(192.168.0.99)让它工作。我这样做是为了快速检查是否正常,因为我在尝试使用我的Raspberry Pi作为节点时收到了类似的消息。 [警告][05/30/2016 11:01:41.432][ClusterSystem akka.remote.defau

  • 我正致力于将一个单节点akka actor系统应用程序改为akka集群。一个变化是将一种有状态的参与者(在运行时可以有很多)变成集群分片托管实体。现在它在多个节点上运行良好。 我面临的一个问题是如何查询(获取全部)在集群中划分区域所创建的实体。以前在单节点模式下,它使用actor system ActorSelection进行actor路径匹配以获得匹配的actor列表,这在集群分片中不再起作用。

  • 在src目录下,我运行下面的命令 但得到以下错误。 创建集群[ERR]抱歉,无法连接到节点127.0.0.1:7000 但是,如果我使用命令“redis server redis.conf”在7000处启动节点,其中redis.conf在下面 端口7000群集已启用是群集配置文件nodes.conf群集节点超时10群集从属有效性系数0 appendonly是 同样,我成功地在所有端口启动了redi

  • 我目前正在尝试使用自动发现服务实现集群play akka实现。然而,我似乎在游戏中包含的Guice DI加载程序上遇到了问题。他们的文件摘录如下: https://www.playframework.com/documentation/2.5.x/ScalaAkka#Integrating-和阿卡 虽然我们建议您使用内置的演员系统,因为它设置了所有内容,如正确的类加载器、生命周期钩子等,但没有什么