简体   繁体   English

Akka.net让单身演员跳过群集中的LightHouse节点吗?

[英]Akka.net Made singleton actor skip LightHouse node in cluster?

I have an akka.net cluster with some singletons for administration and cron tasks. 我有一个akka.net群集,其中包含一些用于管理和cron任务的单例。 Currently the processing nodes are also the seeds ones. 当前,处理节点也是种子节点。

I'd like to create a simple lighthouse that have only the role to be a connection spot for the cluster. 我想创建一个简单的灯塔,只充当群集的连接点。

This way i can restart cluster processing nodes and be sure that the cluster will be recreate correctly. 这样,我可以重新启动群集处理节点,并确保将正确地重新创建群集。

My problem is that singleton mechanisme activate the actor on the oldest node and my lighthouse are considerate like all the other node in my cluster. 我的问题是单例机制会在最旧的节点上激活actor,而我的灯塔就像集群中的所有其他节点一样体贴。

That imply it always try to setup the singleton actor instance in the lighthouse. 这意味着它总是尝试在灯塔中设置单例演员实例。

Is their a way to prevent the lighthouse node to be considered by the singleton host selection mechanisme ? 他们有办法防止单例主机选择机制考虑灯塔节点吗?

Akka.Net has a 'roles' mechanism for this. Akka.Net为此具有“角色”机制。 You can give each node a number of roles, and for a particular type of actor to be created, you can indicate on which node 'roles' it may be created. 您可以为每个节点赋予多个角色,对于要创建的特定类型的actor,您可以指示可以在哪个节点“角色”上创建它。 A dedicated lighthouse (that's not supposed to do anything other than house light has an empty roles list, your real worker nodes have a non-empty list. 专用的灯塔(除了house light ,不应做其他任何事情,角色列表为空,您的实际工作人员节点为非空列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM