Акка Remoting за HAProxy

Я пытаюсь поместить удаленную систему Akka (назовем ее system1) за HAProxy и использовать ее другой системой (назовем ее system2) через прокси. Я использую Akka 2.4, которая имеет функцию "bind-hostname" (да, я использую Akka из репозитория моментальных снимков, так как у меня нет других опций для Akka внутри Docker).

Конфиг для system1:

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 с его балансировкой нагрузки, поскольку я уже реализовал общее (для каждого открытого порта Docker) обнаружение службы для HAProxy, но кластер Akka потребует от меня реализации другого обнаружения службы.

1 ответ

Проблема была довольно глупой: при переходе на связь через балансировщик я случайно внес ошибку в приложение, поэтому актеры никогда не регистрировались в системе1.

Другие вопросы по тегам