FraK
FraK

Reputation: 1089

Akka target nodes for remote routing

I created a remote environment to deploy routees using the following:

Routers with Remote Destinations

deployment {
  /router1 {
    router = round-robin-pool
    nr-of-instances = 7
    cluster {
      enabled = on
      allow-local-routees = off
      max-nr-of-instances-per-node = 3
      use-roles = ["backend"]
      target {
        nodes = ["akka.tcp://[email protected]:2560", "akka.tcp://[email protected]:2570"]
      }
    }
  }
}

This doesn't work. At the end any new node that joins will have routees deployed to it. I thought this configuration meant that "only" on target nodes the routees will be deployed but instead it deploys on "any" new node.

Is this how it works? How can I make the routees to be deployed only on specific nodes? Something must be wrong otherwise adding the "target" configuration does absolutely nothing.

Upvotes: 0

Views: 86

Answers (1)

bumblebee
bumblebee

Reputation: 1841

As mentioned in the Akka documentation

akka.actor.deployment {
    /parent/remotePool {
        router = round-robin-pool
        nr-of-instances = 10
        target.nodes = ["akka.tcp://[email protected]:2552", "akka.tcp://[email protected]:2552"]
    }
}

The above configuration, will clone the actor defined in the Props of the remote pool 10 times and deploy it evenly distributed across the two given target nodes.

Apply this configuration

deployment {
    /router1 {
        router = round-robin-pool
        nr-of-instances = 7
        target {
            nodes = ["akka.tcp://[email protected]:2560","akka.tcp://[email protected]:2570"]
        }
    }
}

Make sure that the ClusterSystem at 127.0.0.1:2560 and ClusterSystem at 127.0.0.1:2570 are running.

Upvotes: 1

Related Questions