I'm new to akka and wanted to connect two PC using akka remotely just to run some code in both as (2 actors). I had tried the example in akka doc. But what I really do is to add the 2 IP addresses into config file I always get this error?
First machine give me this error:
[info] [ERROR] [11/20/2018 13:58:48.833] [ClusterSystem-akka.remote.default-remote-dispatcher-6] [akka.remote.artery.Association(akka://ClusterSystem)] Outbound control stream to [akka://[email protected]:2552] failed. Restarting it. Handshake with [akka://[email protected]:2552] did not complete within 20000 ms (akka.remote.artery.OutboundHandshake$HandshakeTimeoutException: Handshake with [akka://[email protected]:2552] did not complete within 20000 ms)
And second machine:
Exception in thread "main" akka.remote.RemoteTransportException: Failed to bind TCP to [192.168.1.3:2552] due to: Bind failed because of java.net.BindException: Cannot assign requested address: bind
Config file content :
akka {
actor {
provider = cluster
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 0
}
}
cluster {
seed-nodes = [
"akka://[email protected]:2552",
"akka://[email protected]:2552"]
# auto downing is NOT safe for production deployments.
# you may want to use it during development, read more about it in the docs.
auto-down-unreachable-after = 120s
}
}
# Enable metrics extension in akka-cluster-metrics.
akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
# Sigar native library extract location during tests.
# Note: use per-jvm-instance folder when running multiple jvm on one host.
akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native