I have two physical different machines (192.168.1.37 and 192.168.1.99), I can ping easily each machine from the other one. I'm trying to connect them with Akka remote (I'm using Java)
My local machine (trying to send a message to an actor on the remote one) :
akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.37"
canonical.port = 2556
}
}
}
And the code :
ActorSystem system = ActorSystem.create("local", ConfigFactory.load("akka.conf"));
ActorSelection selection = system.actorSelection("akka://[email protected]:2555/user/actor");
selection.tell("trying to connect...", ActorRef.noSender());
Now the config for my remote machine (I started it before launching local one) :
akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.99"
canonical.port = 2555
}
}
}
And the code :
ActorSystem system = ActorSystem.create("remote", ConfigFactory.load("akka.conf"));
ActorRef actor = system.actorOf(Props.create(SimpleActor.class),"actor");
Then I run the remote JVM and start the local one after. Here are the logs I got for the local one :
[INFO] [07/06/2020 19:42:06.950] [main] [akka.remote.artery.tcp.ArteryTcpTransport(akka://local)] Remoting started with transport [Artery tcp]; listening on address [akka://[email protected]:2556] with UID [-6291059934924481437]
[WARN] [07/06/2020 19:42:12.653] [local-akka.remote.default-remote-dispatcher-7] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], message stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired
[WARN] [07/06/2020 19:42:12.653] [local-akka.remote.default-remote-dispatcher-4] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], control stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired
[WARN] [07/06/2020 19:42:12.655] [local-akka.remote.default-remote-dispatcher-4] [RestartWithBackoffFlow(akka://local)] Restarting graph due to failure. stack_trace: (akka.stream.StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired)
[WARN] [07/06/2020 19:42:12.655] [local-akka.remote.default-remote-dispatcher-7] [RestartWithBackoffFlow(akka://local)] Restarting graph due to failure. stack_trace: (akka.stream.StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired)
[WARN] [07/06/2020 19:42:19.349] [local-akka.remote.default-remote-dispatcher-7] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], message stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired
[WARN] [07/06/2020 19:42:19.350] [local-akka.remote.default-remote-dispatcher-7] [RestartWithBackoffFlow(akka://local)] Restarting graph due to failure. stack_trace: (akka.stream.StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired)
[WARN] [07/06/2020 19:42:20.346] [local-akka.remote.default-remote-dispatcher-7] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], control stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired
[WARN] [07/06/2020 19:42:20.346] [local-akka.remote.default-remote-dispatcher-7] [RestartWithBackoffFlow(akka://local)] Restarting graph due to failure. stack_trace: (akka.stream.StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired)
[WARN] [07/06/2020 19:42:26.365] [local-akka.remote.default-remote-dispatcher-4] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], message stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired
[WARN] [07/06/2020 19:42:26.366] [local-akka.remote.default-remote-dispatcher-4] [RestartWithBackoffFlow(akka://local)] Restarting graph due to failure. stack_trace: (akka.stream.StreamTcpException: Tcp command [Connect(192.168.1.99/<unresolved>:2555,None,List(),Some(5000 milliseconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(5000 milliseconds) expired)
[WARN] [07/06/2020 19:42:27.331] [local-akka.remote.default-remote-dispatcher-7] [akka.stream.Log(akka://local/system/StreamSupervisor-0)] [outbound connection to [akka://[email protected]:2555], control stream] Upstream failed, cause: OutboundHandshake$HandshakeTimeoutException: Handshake with [akka://[email protected]:2555] did not complete within 20000 ms
[INFO] [07/06/2020 19:42:27.335] [local-akka.actor.default-dispatcher-3] [akka://local/deadLetters] Message [java.lang.String] without sender to Actor[akka://local/deadLetters] was not delivered. [1] dead letters encountered. If this is not an expected behavior, then [Actor[akka://local/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[ERROR] [07/06/2020 19:42:27.342] [local-akka.remote.default-remote-dispatcher-7] [akka.remote.artery.Association(akka://local)] Outbound message stream to [akka://[email protected]:2555] failed. Restarting it. Handshake with [akka://[email protected]:2555] did not complete within 20000 ms (akka.remote.artery.OutboundHandshake$HandshakeTimeoutException: Handshake with [akka://[email protected]:2555] did not complete within 20000 ms)
[ERROR] [07/06/2020 19:42:27.348] [local-akka.remote.default-remote-dispatcher-7] [akka.remote.artery.Association(akka://local)] Outbound control stream to [akka://[email protected]:2555] failed. Restarting it. Handshake with [akka://[email protected]:2555] did not complete within 20000 ms (akka.remote.artery.OutboundHandshake$HandshakeTimeoutException: Handshake with [akka://[email protected]:2555] did not complete within 20000 ms)