2013-08-16 38 views
4

我是新來的akka​​,並且試圖讓一個樣本在多個JVM之間工作。我正在從example shown here工作,但遇到問題。在下面的日誌結尾處,您可以看到存在AssociationError中,表示與127.0.0.1:2552的連接被拒絕。Akka AssociationError - 局域網地址vs localhost

在日誌前面(15:35:24.543),我看到遠程處理已開始,並且正在偵聽我的LAN地址(我已將其顯示爲WWW.XXX.YYY.ZZZ),而不是本地主機。

15:35:24.307 [RandomOrgSystem-akka.actor.default-dispatcher-2] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started 
15:35:24.319 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG akka.event.EventStream - logger log1-Slf4jLogger started 
15:35:24.320 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/UnhandledMessageForwarder#883086044] 
15:35:24.320 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG akka.event.EventStream - Default Loggers started 
15:35:24.320 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.e.LoggingBus$$anonfun$startDefaultLoggers$2$$anon$1 - started ([email protected]e530a) 
15:35:24.325 [RandomOrgSystem-akka.actor.default-dispatcher-4] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/remoting-terminator#-1650950485] 
15:35:24.339 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG a.r.RemoteActorRefProvider$RemotingTerminator - started ([email protected]) 
15:35:24.355 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/transports#300935452] 
15:35:24.356 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG a.r.Remoting$TransportSupervisor - started ([email protected]) 
15:35:24.359 [RandomOrgSystem-akka.actor.default-dispatcher-3] INFO Remoting - Starting remoting 
15:35:24.364 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/endpointManager#-594071077] 
15:35:24.364 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.r.RemoteActorRefProvider$RemotingTerminator - now monitoring Actor[akka://RandomOrgSystem/system] 
15:35:24.373 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG akka.remote.EndpointManager - started ([email protected]) 
15:35:24.534 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG a.r.Remoting$TransportSupervisor - now supervising Actor[akka://RandomOrgSystem/system/transports/akkaprotocolmanager.tcp0#-2000194523] 
15:35:24.537 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG a.r.transport.AkkaProtocolManager - started ([email protected]) 
15:35:24.543 [RandomOrgSystem-akka.actor.default-dispatcher-5] INFO Remoting - Remoting started; listening on addresses :[akka.tcp://[email protected]:2552] 
15:35:24.545 [RandomOrgSystem-akka.actor.default-dispatcher-2] INFO Remoting - Remoting now listens on addresses: [akka.tcp://[email protected]:2552] 
15:35:24.548 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/remote-watcher#-245042739] 
15:35:24.549 [RandomOrgSystem-akka.actor.default-dispatcher-2] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/remote-deployment-watcher#1846115901] 
15:35:24.550 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG akka.remote.RemoteDeploymentWatcher - started ([email protected]) 
15:35:24.550 [RandomOrgSystem-akka.actor.default-dispatcher-4] DEBUG a.a.LocalActorRefProvider$SystemGuardian - now supervising Actor[akka://RandomOrgSystem/system/deadLetterListener#1544852868] 
15:35:24.552 [RandomOrgSystem-akka.actor.default-dispatcher-4] DEBUG akka.event.DeadLetterListener - started ([email protected]) 
15:35:24.555 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG akka.remote.RemoteWatcher - started ([email protected]) 
15:35:24.555 [RandomOrgSystem-akka.actor.default-dispatcher-5] INFO akka.actor.ActorSystemImpl - Started 
15:35:24.559 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG a.a.LocalActorRefProvider$Guardian - now supervising Actor[akka://RandomOrgSystem/user/buffer#-400157724] 
15:35:24.570 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG RemoteActorRefProvider - [akka://RandomOrgSystem/] Instantiating Remote Actor [akka.tcp://[email protected]:2552/remote/akka.tcp/[email protected]:2552/user/buffer/client] 
15:35:24.581 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG akka.remote.RemoteWatcher - Watching: [akka://RandomOrgSystem/system/remote-deployment-watcher -> akka.tcp://[email protected]:2552/remote/akka.tcp/[email protected]:2552/user/buffer/client] 
15:35:24.582 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG c.b.n.akka.demo.RandomOrgBuffer - started ([email protected]) 
15:35:24.584 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG akka.remote.EndpointManager - now supervising Actor[akka://RandomOrgSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRandomOrgSystem%40127.0.0.1%3A2552-0#-126941538] 
15:35:24.594 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG a.remote.ReliableDeliverySupervisor - started ([email protected]) 
15:35:24.594 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG a.remote.ReliableDeliverySupervisor - now monitoring Actor[akka://RandomOrgSystem/system/endpointManager#-594071077] 
15:35:24.594 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG a.remote.ReliableDeliverySupervisor - now supervising Actor[akka://RandomOrgSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRandomOrgSystem%40127.0.0.1%3A2552-0/endpointWriter#118183353] 
15:35:24.606 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG akka.remote.EndpointWriter - started ([email protected]) 
15:35:24.606 [RandomOrgSystem-akka.actor.default-dispatcher-5] DEBUG akka.remote.EndpointWriter - now monitoring Actor[akka://RandomOrgSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRandomOrgSystem%40127.0.0.1%3A2552-0#-126941538] 
15:35:24.616 [RandomOrgSystem-akka.actor.default-dispatcher-3] DEBUG a.r.transport.AkkaProtocolManager - now supervising Actor[akka://RandomOrgSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRandomOrgSystem%40127.0.0.1%3A2552-1#-1464884820] 
15:35:24.631 [RandomOrgSystem-akka.actor.default-dispatcher-4] DEBUG a.r.transport.ProtocolStateActor - started ([email protected]) 
15:35:24.656 [RandomOrgSystem-akka.actor.default-dispatcher-5] ERROR akka.remote.EndpointWriter - AssociationError [akka.tcp://[email protected]:2552] -> [akka.tcp://[email protected]:2552]: Error [Association failed with [akka.tcp://[email protected]:2552]] [ 
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://[email protected]:2552] 
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: Connection refused: /127.0.0.1:2552 
] 

我想它,如果遠程對本地主機地址開始,所以,我沒有當我改變IP地址重新配置。我application.conf包含:

akka { 
    log-config-on-start = off 
    loggers = ["akka.event.slf4j.Slf4jLogger"] 
    loglevel = "DEBUG" 
    actor { 
     provider = "akka.remote.RemoteActorRefProvider" 
     debug { 
      receive = on 
      autoreceive = on 
      lifecycle = on 
      unhandled = on 
     } 
     deployment { 
      /buffer/client { 
       remote = "akka.tcp://[email protected]:2552" 
      } 
     } 
    } 
    remote { 
     transport = "akka.remote.netty.NettyRemoteTransport" 
     log-sent-messages = on 
     netty { 
      hostname = "127.0.0.1" 
     } 
    } 
} 

感謝, 湯姆

回答

4

試着改變你的remote部分:

remote { 
    transport = "akka.remote.netty.NettyRemoteTransport" 
    log-sent-messages = on 
    netty.tcp { 
     hostname = "127.0.0.1" 
    } 
} 

因爲配置是錯誤的,你是不是指定hostname屬性,則默認爲使用主機IP。如上所示設置配置將允許您使用環回。

+0

謝謝,試過(改變「netty」爲「netty.tcp」,沒有看到任何其他差異)。想到還有同樣的錯誤。 – yotommy

+0

@yotommy,你在用什麼版本的阿卡? – cmbaxter

+1

對不起,您的建議完美。在src樹中有兩個application.conf文件,我只在其中一個文件中進行編輯。我需要研究並瞭解爲什麼有兩個。謝謝您的幫助! – yotommy

相關問題