我使用以下方法创建了一个远程环境来部署路由:
具有远程目标的路由器
部署{ / router1 { router = round-robin-pool nr-of-instances = 7 集群{ …
正如在提到的那样 Akka文档
akka.actor.deployment { /parent/remotePool { router = round-robin-pool nr-of-instances = 10 target.nodes = ["akka.tcp://app@10.0.0.2:2552", "akka.tcp://app@10.0.0.3:2552"] } }
上面的配置,将克隆在中定义的actor Props 的 remote pool 10 时间并将其均匀分布在两个给定的目标节点上。
Props
remote pool
10
应用此配置
deployment { /router1 { router = round-robin-pool nr-of-instances = 7 target { nodes = ["akka.tcp://ClusterSystem@127.0.0.1:2560","akka.tcp://ClusterSystem@127.0.0.1:2570"] } } }
确保 ClusterSystem 在 127.0.0.1:2560 和 ClusterSystem 在 127.0.0.1:2570 正在跑步。
ClusterSystem
127.0.0.1:2560
127.0.0.1:2570