Cluster processing and actor selection / routing

386 views
Skip to first unread message

Jem Mawson

unread,
Apr 2, 2014, 9:46:09 PM4/2/14
to akka...@googlegroups.com
Hi

I would like a cluster singleton actor that delegates work randomly (or uniformly) to worker actors on the cluster. In the docs for `actorSelection` it says "No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors". I take this to mean that I must roll my own implementation of finding a random actor to handle a work request. Or should I be using a Router to distribute the work across the cluster. If so, how do I add the workers to the route?

Additionally, what is the correct selector for finding remote actors in a cluster? With actors such as [akka.tcp://Cluste...@192.168.161.139:2551/user/ponger-0..n], I tried things like "//ClusterSystem*/ponger-*" and variations without success. Either I match nothing, or I match only the actors on the current node.

Thank you
Jem


Jem

unread,
Apr 3, 2014, 6:20:59 PM4/3/14
to akka...@googlegroups.com
Chapter 14 of Akka in Action is answering my questions nicely. Please ignore the above. 

But I do have 2 follow-on questions from the material in this chapter that someone might be able to help me with.
  1. The examples often show the creation of dedicated seed nodes, as well as separate master and worker nodes. I only have two hosts in each of my environments. Do I *need* to have different roles? I'd prefer to have every deployable the same. Can I simply have 1 node per machine and have it do all roles? What is the downside of this approach?

  2. In the example we build in this chapter The JobMaster actor creates remote JobWorker actors via a pool. The JobWorkers immediately send an Enlist message to advise that they are ready for work. When the jobs are done they are killed. Why is the Enlist message necessary? The master created them for its own, dedicated use. Shouldn't they be born enlisted?

Thanks
Jem




--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/KWjIFwmf26c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Patrik Nordwall

unread,
Apr 8, 2014, 3:43:40 AM4/8/14
to akka...@googlegroups.com
Hi Jem,


On Fri, Apr 4, 2014 at 12:20 AM, Jem <jem.m...@gmail.com> wrote:
Chapter 14 of Akka in Action is answering my questions nicely. Please ignore the above. 

But I do have 2 follow-on questions from the material in this chapter that someone might be able to help me with.
  1. The examples often show the creation of dedicated seed nodes, as well as separate master and worker nodes. I only have two hosts in each of my environments. Do I *need* to have different roles? I'd prefer to have every deployable the same. Can I simply have 1 node per machine and have it do all roles? What is the downside of this approach?


You don't have to use different roles, and seed nodes is nothing more than initial contact points for new nodes joining the cluster.
 
  1. In the example we build in this chapter The JobMaster actor creates remote JobWorker actors via a pool. The JobWorkers immediately send an Enlist message to advise that they are ready for work. When the jobs are done they are killed. Why is the Enlist message necessary? The master created them for its own, dedicated use. Shouldn't they be born enlisted?

I'm sorry, I don't know the details of that sample.

/Patrik 
Thanks
Jem




On 3 April 2014 12:46, Jem Mawson <jem.m...@gmail.com> wrote:
Hi

I would like a cluster singleton actor that delegates work randomly (or uniformly) to worker actors on the cluster. In the docs for `actorSelection` it says "No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors". I take this to mean that I must roll my own implementation of finding a random actor to handle a work request. Or should I be using a Router to distribute the work across the cluster. If so, how do I add the workers to the route?

Additionally, what is the correct selector for finding remote actors in a cluster? With actors such as [akka.tcp://Cluste...@192.168.161.139:2551/user/ponger-0..n], I tried things like "//ClusterSystem*/ponger-*" and variations without success. Either I match nothing, or I match only the actors on the current node.

Thank you
Jem


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/KWjIFwmf26c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Reply all
Reply to author
Forward
0 new messages