Akka Cluster "Connection Refused" Confusion
<p>I've been studying Akka Clusters via the <em>akka-sample-cluster-app</em> tutorial and this <a href="http://doc.akka.io/docs/akka/current/scala/cluster-usage.html" rel="nofollow">documentation</a>. I have it running locally (127.0.0.1), but I can't seem to get it working using my static IP (192.168.0.99). I'm doing this as a quick sanity check because I'm getting similar messages while trying to use my Raspberry Pi's as nodes.</p>

<blockquote>
  <p>[WARN] [05/30/2016 11:01:41.432]
  [ClusterSystem-akka.remote.default-remote-dispatcher-8]
  [akka.tcp://ClusterSystem@127.0.0.1:63599/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40192.168.0.99%3A2552-1]
  Association with remote system
  [akka.tcp://ClusterSystem@192.168.0.99:2552] has failed, address is
  now gated for [5000] ms. Reason: [Association failed with
  [akka.tcp://ClusterSystem@192.168.0.99:2552]] <strong>Caused by: [Connection
  refused: no further information: /192.168.0.99:2552]</strong></p>
</blockquote>

<p>I believe I'm getting a connection refused error because there's nothing listening on port 2552, but I'm confused about why. How does the Akka program get put on the nodes and begin running? Why does it work with 127.0.0.1 and not my static IP? </p>

<p>As far as I can tell, no where in this tutorial or documentation does it explicitly say: "You need to compile a separate program for your nodes." So does the program get pushed to the nodes from the main Akka server or do I need to create another project for my nodes? </p>

<p>I'm guess the former, but then how/why are people doing their node development in the same project as their server? How are they running the same jar differently as a server and as a node?</p>

<p>EDIT:</p>

<pre><code>Address of Raspberry Pi Node 1: 192.168.0.8
Address of Raspberry Pi Node 2: 192.168.0.9
Address of Desktop Computer: 192.168.0.99
</code></pre>

<p>application.conf on Desktop Computer (Note hostname)</p>

<pre><code>#//#snippet
akka {

    log-dead-letters = off
    log-level = "debug"

  actor {
    provider = "akka.cluster.ClusterActorRefProvider"
  }
  remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "192.168.0.99"
      port = 2552
    }
  }

  cluster {
    seed-nodes = [
      "akka.tcp://ClusterSystem@192.168.0.8:2552",
      "akka.tcp://ClusterSystem@192.168.0.9:2552"]

    #//#snippet
    # excluded from snippet
    auto-down-unreachable-after = 10s
    #//#snippet
    # 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 = 10s
  }
}

# Disable legacy metrics in akka-cluster.
akka.cluster.metrics.enabled=off

# 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
#//#snippet
</code></pre>

<p>application.conf on Raspberry Pi Node 2 (Similar on Node 1, just different hostname)</p>

<pre><code>#//#snippet
akka {

    log-dead-letters = off
    log-level = "debug"

  actor {
    provider = "akka.cluster.ClusterActorRefProvider"
  }
  remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "192.168.0.9"
      port = 2552
    }
  }

  cluster {
    seed-nodes = [
      "akka.tcp://ClusterSystem@192.168.0.8:2552",
      "akka.tcp://ClusterSystem@192.168.0.9:2552"]

    #//#snippet
    # excluded from snippet
    auto-down-unreachable-after = 10s
    #//#snippet
    # 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 = 10s
  }
}

# Disable legacy metrics in akka-cluster.
akka.cluster.metrics.enabled=off

# 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
#//#snippet
</code></pre>

<p>With this I get "No route to host" on the node as I try to bring it up.</p>

<p>EDIT 2:</p>

<p>Because main is at simple.sample.cluster.simple.SimpleClusterApp I have to launch my node with "java -cp cluster.jar simple.sample.cluster.simple.SimpleClusterApp". Does that seem right? I assume this is the same tutorial project I'm compiling/assembling for both the node and the desktop? Or do I need to create an entirely different project for my nodes?? I'm so confused. The tutorial is terrible for newcomers.</p>