我试图将远程 Akka系统(我们称之为system1 )放在 HAProxy 后面,并通过代理由另一个系统(我们称之为system2 )使用它。我正在使用 Akka 2.4,它具有“绑定主机名”功能(是的,我正在使用来自快照存储库的 Akka,因为我在 Docker 中没有其他 Akka 选项)。
系统 1的配置:
akka {
loglevel = DEBUG
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
netty.tcp {
bind-hostname = "0.0.0.0"
bind-port = 9000
hostname = ${proxyServerIp}
port = 9000
}
}
}
并为system2配置:
akka {
loglevel = DEBUG
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
netty.tcp {
bind-hostname = "0.0.0.0"
bind-port = 9001
hostname = ${proxyServerIp}
port = 9001
}
}
}
其中proxyServerIp是带有 HAProxy 的服务器。我已经在本地测试了配置,将proxyServerIp替换为我的本地机器 IP 地址,并且没有错误。但是当我尝试在 prod 上启动它时,我在system1上得到以下信息:
Feb 20 01:58:37 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:37.113] [System1-akka.remote.default-remote-dispatcher-6] [akka.remote.Remoting] Associated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:37 where12 sh[30586]: [INFO] [02/20/2015 01:58:37.330] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] 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'.
Feb 20 01:58:37 where12 sh[30586]: [INFO] [02/20/2015 01:58:37.334] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [2] 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'.
Feb 20 01:58:37 where12 sh[30586]: [INFO] [02/20/2015 01:58:37.337] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [3] 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'.
Feb 20 01:58:37 where12 sh[30586]: [INFO] [02/20/2015 01:58:37.340] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [4] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.392] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [5] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.395] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [6] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.398] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [7] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.416] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [8] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.431] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [9] 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'.
Feb 20 01:58:39 where12 sh[30586]: [INFO] [02/20/2015 01:58:39.433] [System1-akka.actor.default-dispatcher-2] [akka://System1/user/EntryExtractingActor] Message [wh.extractor.ExtractedEntry] from Actor[akka://System1/deadLetters] to Actor[akka://System1/user/EntryExtractingActor] was not delivered. [10] dead letters encountered, no more dead letters will be logged. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
Feb 20 01:58:40 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:40.604] [System1-akka.remote.default-remote-dispatcher-14] [akka.remote.Remoting] Associated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:40 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:40.633] [System1-akka.remote.default-remote-dispatcher-14] [akka.tcp://System1@10.130.184.248:9000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem2%4010.130.184.248%3A9001-0/endpointWriter] Disassociated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:46 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:46.437] [System1-akka.remote.default-remote-dispatcher-6] [akka.remote.Remoting] Associated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:46 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:46.449] [System1-akka.remote.default-remote-dispatcher-6] [akka.tcp://System1@10.130.184.248:9000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem2%4010.130.184.248%3A9001-1/endpointWriter] Disassociated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:53 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:53.792] [System1-akka.remote.default-remote-dispatcher-6] [akka.remote.Remoting] Associated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
Feb 20 01:58:53 where12 sh[30586]: [DEBUG] [02/20/2015 01:58:53.807] [System1-akka.remote.default-remote-dispatcher-14] [akka.tcp://System1@10.130.184.248:9000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem2%4010.130.184.248%3A9001-2/endpointWriter] Disassociated [akka.tcp://System1@10.130.184.248:9000] <- [akka.tcp://System2@10.130.184.248:9001]
以及system2上的以下内容:
Feb 20 02:00:43 where12 sh[30704]: [DEBUG] [02/20/2015 02:00:43.685] [System2-akka.remote.default-remote-dispatcher-14] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Associated [akka.tcp://System2@10.130.184.248:9001] -> [akka.tcp://System1@10.130.184.248:9000]
Feb 20 02:00:43 where12 sh[30704]: [DEBUG] [02/20/2015 02:00:43.830] [System2-akka.remote.default-remote-dispatcher-6] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Drained buffer with maxWriteCount: 50, fullBackoffCount: 1, smallBackoffCount: 0, noBackoffCount: 5 , adaptiveBackoff: 1000
Feb 20 02:01:01 where12 sh[30704]: [DEBUG] [02/20/2015 02:01:01.448] [System2-akka.remote.default-remote-dispatcher-6] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Disassociated [akka.tcp://System2@10.130.184.248:9001] -> [akka.tcp://System1@10.130.184.248:9000]
Feb 20 02:01:01 where12 sh[30704]: [WARN] [02/20/2015 02:01:01.451] [System2-akka.remote.default-remote-dispatcher-14] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0] Association with remote system [akka.tcp://System1@10.130.184.248:9000] has failed, address is now gated for [5000] ms. Reason: [Disassociated]
Feb 20 02:01:01 where12 sh[30704]: [DEBUG] [02/20/2015 02:01:01.452] [System2-akka.remote.default-remote-dispatcher-6] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Disassociated [akka.tcp://System2@10.130.184.248:9001] ->[akka.tcp://System1@10.130.184.248:9000]
Feb 20 02:01:09 where12 sh[30704]: [DEBUG] [02/20/2015 02:01:08.613] [System2-akka.remote.default-remote-dispatcher-6] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Associated [akka.tcp://System2@10.130.184.248:9001] -> [akka.tcp://System1@10.130.184.248:9000]
Feb 20 02:01:09 where12 sh[30704]: [DEBUG] [02/20/2015 02:01:08.950] [System2-akka.remote.default-remote-dispatcher-14] [akka.tcp://System2@10.130.184.248:9001/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FSystem1%4010.130.184.248%3A9000-0/endpointWriter] Drained buffer with maxWriteCount: 50, fullBackoffCount: 1, smallBackoffCount: 0, noBackoffCount: 5 , adaptiveBackoff: 1000
看起来消息到达了他们的目标系统,但由于某种原因没有发送给参与者。任何想法为什么?
PS 我不想将Akka Clustering与它的负载平衡一起使用,因为我已经为 HAProxy 实现了通用(针对每个暴露的 Docker 端口)服务发现,但是Akka Clustering将要求我实现另一个服务发现。