Connect two machines in AKKA remotely ,connection refused












0















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://ClusterSystem@192.168.1.2:2552] failed.
Restarting it. Handshake with [akka://ClusterSystem@192.168.1.2:2552]
did not complete within 20000 ms
(akka.remote.artery.OutboundHandshake$HandshakeTimeoutException:
Handshake with [akka://ClusterSystem@192.168.1.2: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://ClusterSystem@192.168.1.3:2552",
"akka://ClusterSystem@192.168.1.2: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









share|improve this question

























  • First of all you need to fix binding problem on the second pc.

    – Aleksey Isachenkov
    Nov 20 '18 at 12:25


















0















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://ClusterSystem@192.168.1.2:2552] failed.
Restarting it. Handshake with [akka://ClusterSystem@192.168.1.2:2552]
did not complete within 20000 ms
(akka.remote.artery.OutboundHandshake$HandshakeTimeoutException:
Handshake with [akka://ClusterSystem@192.168.1.2: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://ClusterSystem@192.168.1.3:2552",
"akka://ClusterSystem@192.168.1.2: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









share|improve this question

























  • First of all you need to fix binding problem on the second pc.

    – Aleksey Isachenkov
    Nov 20 '18 at 12:25
















0












0








0








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://ClusterSystem@192.168.1.2:2552] failed.
Restarting it. Handshake with [akka://ClusterSystem@192.168.1.2:2552]
did not complete within 20000 ms
(akka.remote.artery.OutboundHandshake$HandshakeTimeoutException:
Handshake with [akka://ClusterSystem@192.168.1.2: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://ClusterSystem@192.168.1.3:2552",
"akka://ClusterSystem@192.168.1.2: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









share|improve this question
















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://ClusterSystem@192.168.1.2:2552] failed.
Restarting it. Handshake with [akka://ClusterSystem@192.168.1.2:2552]
did not complete within 20000 ms
(akka.remote.artery.OutboundHandshake$HandshakeTimeoutException:
Handshake with [akka://ClusterSystem@192.168.1.2: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://ClusterSystem@192.168.1.3:2552",
"akka://ClusterSystem@192.168.1.2: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






scala akka






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 12:42









hasumedic

1,981715




1,981715










asked Nov 20 '18 at 12:14









NaseemMahasnehNaseemMahasneh

185




185













  • First of all you need to fix binding problem on the second pc.

    – Aleksey Isachenkov
    Nov 20 '18 at 12:25





















  • First of all you need to fix binding problem on the second pc.

    – Aleksey Isachenkov
    Nov 20 '18 at 12:25



















First of all you need to fix binding problem on the second pc.

– Aleksey Isachenkov
Nov 20 '18 at 12:25







First of all you need to fix binding problem on the second pc.

– Aleksey Isachenkov
Nov 20 '18 at 12:25














1 Answer
1






active

oldest

votes


















0














First of all, you don't need to add cluster configuration for AKKA remoting. Both the PCs or nodes should be enabled remoting with a concrete port instead of "0" that way you know which port to connect.



Have below configurations



PC1



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 19000
}
}
}


PC2



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.4"
canonical.port = 18000
}
}
}


Use below actor path to connect any actor in remote from PC1 to PC2



akka://<PC2-ActorSystem>@192.168.1.4:18000/user/<actor deployed in PC2>


Use below actor path to connect from PC2 to PC1



akka://<PC2-ActorSystem>@192.168.1.3:19000/user/<actor deployed in PC1>


Port numbers and IP address are samples.






share|improve this answer
























  • Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

    – NaseemMahasneh
    Nov 21 '18 at 8:12











  • I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

    – Gajendra Naidu
    Nov 21 '18 at 17:40











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392787%2fconnect-two-machines-in-akka-remotely-connection-refused%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














First of all, you don't need to add cluster configuration for AKKA remoting. Both the PCs or nodes should be enabled remoting with a concrete port instead of "0" that way you know which port to connect.



Have below configurations



PC1



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 19000
}
}
}


PC2



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.4"
canonical.port = 18000
}
}
}


Use below actor path to connect any actor in remote from PC1 to PC2



akka://<PC2-ActorSystem>@192.168.1.4:18000/user/<actor deployed in PC2>


Use below actor path to connect from PC2 to PC1



akka://<PC2-ActorSystem>@192.168.1.3:19000/user/<actor deployed in PC1>


Port numbers and IP address are samples.






share|improve this answer
























  • Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

    – NaseemMahasneh
    Nov 21 '18 at 8:12











  • I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

    – Gajendra Naidu
    Nov 21 '18 at 17:40
















0














First of all, you don't need to add cluster configuration for AKKA remoting. Both the PCs or nodes should be enabled remoting with a concrete port instead of "0" that way you know which port to connect.



Have below configurations



PC1



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 19000
}
}
}


PC2



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.4"
canonical.port = 18000
}
}
}


Use below actor path to connect any actor in remote from PC1 to PC2



akka://<PC2-ActorSystem>@192.168.1.4:18000/user/<actor deployed in PC2>


Use below actor path to connect from PC2 to PC1



akka://<PC2-ActorSystem>@192.168.1.3:19000/user/<actor deployed in PC1>


Port numbers and IP address are samples.






share|improve this answer
























  • Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

    – NaseemMahasneh
    Nov 21 '18 at 8:12











  • I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

    – Gajendra Naidu
    Nov 21 '18 at 17:40














0












0








0







First of all, you don't need to add cluster configuration for AKKA remoting. Both the PCs or nodes should be enabled remoting with a concrete port instead of "0" that way you know which port to connect.



Have below configurations



PC1



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 19000
}
}
}


PC2



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.4"
canonical.port = 18000
}
}
}


Use below actor path to connect any actor in remote from PC1 to PC2



akka://<PC2-ActorSystem>@192.168.1.4:18000/user/<actor deployed in PC2>


Use below actor path to connect from PC2 to PC1



akka://<PC2-ActorSystem>@192.168.1.3:19000/user/<actor deployed in PC1>


Port numbers and IP address are samples.






share|improve this answer













First of all, you don't need to add cluster configuration for AKKA remoting. Both the PCs or nodes should be enabled remoting with a concrete port instead of "0" that way you know which port to connect.



Have below configurations



PC1



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.3"
canonical.port = 19000
}
}
}


PC2



akka {
actor {
provider = remote
}
remote {
artery {
enabled = on
transport = tcp
canonical.hostname = "192.168.1.4"
canonical.port = 18000
}
}
}


Use below actor path to connect any actor in remote from PC1 to PC2



akka://<PC2-ActorSystem>@192.168.1.4:18000/user/<actor deployed in PC2>


Use below actor path to connect from PC2 to PC1



akka://<PC2-ActorSystem>@192.168.1.3:19000/user/<actor deployed in PC1>


Port numbers and IP address are samples.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 14:02









Gajendra NaiduGajendra Naidu

264113




264113













  • Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

    – NaseemMahasneh
    Nov 21 '18 at 8:12











  • I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

    – Gajendra Naidu
    Nov 21 '18 at 17:40



















  • Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

    – NaseemMahasneh
    Nov 21 '18 at 8:12











  • I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

    – Gajendra Naidu
    Nov 21 '18 at 17:40

















Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

– NaseemMahasneh
Nov 21 '18 at 8:12





Thanks.Could I know where to add the actor paths ,is it in the conf file If so what is the syntax ?

– NaseemMahasneh
Nov 21 '18 at 8:12













I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

– Gajendra Naidu
Nov 21 '18 at 17:40





I think you need to understand the basics of AKKA and Actor model. You may google or you may look at this tutorial javatpoint.com/akka-tutorial

– Gajendra Naidu
Nov 21 '18 at 17:40


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392787%2fconnect-two-machines-in-akka-remotely-connection-refused%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith