Akka Cluster Connection Refused Between Machines

I am crossposting this issue between here and StackOverflow (https://stackoverflow.com/questions/64108688/akka-cluster-connection-refused-between-machines) since this is specific to Akka.

I am attempting to make a project using Akka Clustering, and have been using the akka-cluster-sample-scala from Lightbend(https://github.com/akka/akka-samples/tree/2.6/akka-sample-cluster-scala) as a base. As it lacks much direct information on connecting across a network, I modified the application.conf to look more like this:

akka {
  actor {
    provider = cluster

    serialization-bindings {
      "sample.cluster.CborSerializable" = jackson-cbor
  remote {
    artery {
      canonical.hostname = ""
      canonical.port = 0
  cluster {
    seed-nodes = [
    downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider"

When run across these two machines, Akka fails to be able to connect over TCP between them, leading to the following warnings:

[info] [2020-09-28 14:34:37,877] [WARN] [akka.stream.Materializer] [] [ClusterSystem-akka.actor.default-dispatcher-5] - [outbound connection to [akka://ClusterSystem@], control stream] Upstream failed, cause: StreamTcpException: Tcp command [Connect(,None,List(),Some(5000 milliseconds),true)] failed because of java.net.ConnectException: Connection refused

Is there anything notably wrong that may be causing this, or something more specifically needing to be reconfigured in order to allow connection over TCP between these machines?

canonical.hostname cannot be and port 0 but must be configured to be the public ip/hostname and port that other nodes can use to reach the node.

So for it needs to be and 25251 for example.


Thank you so much for taking the time to respond. This just helped immensely.