Hi Eugene, On 12 May 2014 at 22:11:03, Ryan Tanner ([email protected]) wrote:
1) which router/deployed I need to use in order to start actors of certain type on nodes with an appropriate role? http://doc.akka.io/docs/akka/2.3.2/scala/cluster-usage.html#Cluster_Aware_Routers 2) I want to share a "job state" with all actors involved in the job processing, so even if only one "worker" actor survives - it can "restart" the entire job "from scratch". Is it a good idea, or there's some cluster-wide storage I could use for such purpose? You could just keep the work in a queue and subscribe to DeathWatch so the controller is notified if that actor dies. If it does, send the work off to another actor. http://letitcrash.com/post/29044669086/balancing-workload-across-nodes-with-akka-2 There are also Activator templates available with a tutorial and working code for work pulling. https://typesafe.com/activator/template/akka-distributed-workers http://typesafe.com/activator/template/akka-distributed-workers-java On Monday, May 12, 2014 1:53:53 PM UTC-6, Eugene Dzhurinsky wrote: Hello! I have nodes in a cluster with different roles, like "worker", "controller" and "datasource". When I want to start a job in the cluster, I want to start an actor of type DataSource on a (random/least loaded) node in the cluster with the role "datasource", then start another actor on a node with the role "controller", and pass the reference of that "controller" actor to the "datasource" actor. So the "controller" could then spawn as many "worker" actors on nodes with the role "worker" upon receiving an event from the "datasource" actor. So my questions are: 1) which router/deployed I need to use in order to start actors of certain type on nodes with an appropriate role? 2) I want to share a "job state" with all actors involved in the job processing, so even if only one "worker" actor survives - it can "restart" the entire job "from scratch". Is it a good idea, or there's some cluster-wide storage I could use for such purpose? 3) is it possible to start an actor of certain type from outside of the cluster via ClusterClient? Or I need to have some sort of "manager" actor, which will accept the job and start the whole set of actors inside the cluster? It is not possible to create actors directly inside the cluster via the ClusterClient. It can only send messages to actors that have registered with the ClusterReceptionist. As you said, you can create a manager in the cluster that performs the actor creation on your behalf. B/ Thanks! -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe – Reactive Apps on the JVM twitter: @bantonsson JOIN US. REGISTER TODAY! Scala Days June 16th-18th, Berlin -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
