I want to create an AKKA cluster, my application is load balanced across 4 servers each with an identical copy of the code and acting independently.

With AKKA the cluster is defined along with it's seed-nodes in application.conf. However due to the nature of my application i will have four versions of this application.conf file each one with a set of seed-nodes which will result in 4 clusters, one on each application node. I want to end up with a situation where i have a single cluster, how can i configure this using Akka clustering?

Code deployed on each node would look like this, all with the same hostname.

    remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "server1.com"
      port = 0
    }
  }
     cluster {
        seed-nodes = [
          "akka.tcp://ClusterSystem@server1:1234",
          "akka.tcp://ClusterSystem@server2:1235",
          "akka.tcp://ClusterSystem@server3:1236",
          "akka.tcp://ClusterSystem@server4:1237"]
有帮助吗?

解决方案

If you want to use single or equal Akka cluster config among all the nodes, AFAIK, the only way is to clear the hostname (in case of hostname = "" Akka should use InetAddress.getLocalHost.getHostAddress for the hostname). And you should use such IP addresses in your list of seed nodes.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top