一個小例子是粘貼在這裏: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。我並不完全清楚文檔的建議,因爲創建新工作人員應該改變集羣成員,但是無論我創建了多少新員工,路由器仍然不會意識到它們。
如果我先啓動一個工作節點,然後調度程序,工作人員收到的消息就好了。
總結:我想要一個可以在羣集中的第一個種子節點上啓動的羣集感知路由器。包含路由器路由的任何新節點在加入集羣時應該可供路由器使用。