Akka remote actor server discovery

后端 未结 3 956
走了就别回头了
走了就别回头了 2021-02-06 01:02

I would like to deploy a remote actors software made with akka on a cluster. The system is composed of several worker nodes and a single master node. The problem is that I canno

3条回答
  •  梦谈多话
    2021-02-06 01:37

    Unless all nodes share some common knowledge, I think your solution would have to rely on IP broadcast. Broadcasting is defined as sending a packet to all network nodes on a subnet, so if your master node does that while all worker nodes listen for it, you should be able to connect them all without knowing the IP addresses a priori.

    I haven't coded this in Scala, but here's a fairly readable example of how to broadcast messages in java: http://download.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html. It should be straightforward to adapt it to Scala using the same classes.

提交回复
热议问题