0
votes

I am new to akka and akka remoting and akka cluster. I have build a system with following config

Application.conf

akka {
  actor.provider = "akka.cluster.ClusterActorRefProvider"


  extensions = ["akka.contrib.pattern.ClusterReceptionistExtension"]

  actor.provider = "akka.cluster.ClusterActorRefProvider"

  remote{
    netty.tcp{
        port = 0
        hostname = "127.0.0.1"
    }
  }
  cluster {
    seed-nodes = [
      "akka.tcp://[email protected]:8551",
      "akka.tcp://[email protected]:8552"]

    auto-down-unreachable-after = 10s
  }

  extensions = ["akka.contrib.pattern.ClusterReceptionistExtension"]

  persistence {
    journal.plugin = "akka.persistence.journal.leveldb-shared"
    journal.leveldb-shared.store {
      # DO NOT USE 'native = off' IN PRODUCTION !!!
      native = off
      dir = "target/shared-journal"
    }
    snapshot-store.local.dir = "target/snapshots"
  }

}

worker.conf

akka {

  actor.provider = "akka.remote.RemoteActorRefProvider"

   remote{
    netty.tcp{
        port = 0
        hostname = "127.0.0.1"
    }
  }

}

contact-points = [
  "akka.tcp://[email protected]:8551",
  "akka.tcp://[email protected]:8552"]

The undestanding was akka system would start in my local and would use the seed nodes to form cluster. does this mean the seed nodes should be aldready running. meaning should the process be aldready started on these ip:port?

The reason is: if dont have this procress aldready running i get association failed and because its gated.

*******UPADTE*******

The above issue was becuse of using floating ips. My nodes are running on Openstack Vm's and they do have a static IP. Using static IP solved issue.

ANother intresting find. When nodes are started the hostname in remote.netty.tcp should be the machines inet and as Ryan mentioned one of the seednodes need to be up for the cluster to start hence having the local machine to be a seed node is better. And prefer using localhost inet IP instead of 127.0.0.1 if you have distributed seed nodes.

1

1 Answers

0
votes

Yes, as the documentation says, the first node listed as a seed must be running for the other seeds to be properly initialized:

The seed nodes can be started in any order and it is not necessary to have all seed nodes running, but the node configured as the first element in the seed-nodes configuration list must be started when initially starting a cluster, otherwise the other seed-nodes will not become initialized and no other node can join the cluster. The reason for the special first seed node is to avoid forming separated islands when starting from an empty cluster. It is quickest to start all configured seed nodes at the same time (order doesn't matter), otherwise it can take up to the configured seed-node-timeout until the nodes can join.

http://doc.akka.io/docs/akka/2.3.9/scala/cluster-usage.html