Search code examples
scalaakkaakka-clusterakka-remote-actor

Akka-cluster discovering other machines in local network


I'm trying to run http://typesafe.com/activator/template/akka-distributed-workers on few machines connected to local network.

I want to host configuration be as transparent as possible, so I set in my project configuration just linux.local (as netty.tcp.hostname and as seed nodes) and at each machine there is a avahi daemon which is resolving linux.local to appropriate IP address.

Should akka-cluster/akka-remote discover other machines automatically using gossip protocol or above configuration won't be work and I need to explicitly set on each machine the IP address e.g. passing it by argument?


Solution

  • You need to set the hostname configuration on each machine to be an address where that machine can be contacted by the other nodes in the cluster.

    So unfortunately, the configuration does need to be different on each node. One way to do this is to override the host configuration programmatically in your application code.

    The seed nodes list, however, should be the same for all the nodes, and also should be the externally accessible addresses.