简体   繁体   中英

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

I have an akka.net cluster with some singletons for administration and cron tasks. 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.

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. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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