一个小例子是粘贴在这里:http://lpaste.net/94385阿卡群集感知路由器无法找到routees
我希望能够启动一个主调度机为我的集群种子节点。分派器具有一个指向集群工作人员的集群感知路由器。我希望能够根据需要启动工作机器,并自动让调度路由器知道它们的存在,以便它可以开始将工作发送给它们。
问题是,如果我首先启动Dispatcher机器(因为它是种子节点),则启动群集感知路由器并且找不到任何路由(足够公平,它们尚未启动)。该文档提到这一点:
The routee actors should be started as early as possible when starting the
actor system, because the router will try to use them as soon as the member
status is changed to 'Up'. If it is not available at that point it will be
removed from the router and it will only re-try when the cluster members are changed.
当我开始一个新的工作机器,我可以看到,它已经加入群集,但发送到我的路由器的任何消息转发给deadletters。我并不完全清楚文档的建议,因为创建新工作人员应该改变集群成员,但是无论我创建了多少新员工,路由器仍然不会意识到它们。
如果我先启动一个工作节点,然后调度程序,工作人员收到的消息就好了。
总结:我想要一个可以在群集中的第一个种子节点上启动的群集感知路由器。包含路由器路由的任何新节点在加入集群时应该可供路由器使用。