--
>>>>>>>>>> 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
Patrik,
It says what's wrong-that the address is already in use.
Cheers,
V
--
/*** Global.java** This class allows to handle global settings for the application.** Copyright(c) 2014 Equinix, Inc. All Rights Reserved.* This software is the proprietary information of Equinix.**/import java.util.HashSet;import java.util.Set;import java.util.concurrent.TimeUnit;import play.Application;import play.GlobalSettings;import play.Logger;import play.libs.Akka;import scala.concurrent.duration.Duration;import scala.concurrent.duration.FiniteDuration;import akka.actor.ActorRef;import akka.actor.ActorSelection;import akka.actor.ActorSystem;import akka.actor.Address;import akka.actor.PoisonPill;import akka.actor.Props;import akka.cluster.Cluster;import akka.contrib.pattern.ClusterClient;import akka.contrib.pattern.ClusterSingletonManager;import akka.contrib.pattern.ClusterSingletonPropsFactory;import play.cache.Cache;import com.equinix.fase.job.product.master.Frontend;import com.equinix.fase.job.product.master.Master;import com.equinix.fase.job.product.master.WorkProducer;import com.equinix.fase.job.product.master.WorkResultConsumer;import com.equinix.fase.job.product.worker.ProductListActor;import com.equinix.fase.job.product.worker.WorkExecutor;import com.equinix.fase.job.product.worker.Worker;import com.typesafe.config.Config;import com.typesafe.config.ConfigFactory;public class Global extends GlobalSettings {private static String systemName = "Workers";private static FiniteDuration workTimeout = Duration.create(120, "seconds");@Overridepublic void onStart(Application application) {//Address joinAddress = startBackend(new Address("akka.tcp", systemName, "127.0.0.1", 57779), "backend");Address joinAddress = startBackend(null, "backend");Cache.set("seedAddress",joinAddress);Logger.info("The join address is - " + joinAddress);try {Thread.sleep(5000);startBackend(joinAddress, "backend");startWorker(joinAddress);} catch (InterruptedException e) {e.printStackTrace();}super.onStart(application);}public static Address startBackend(Address joinAddress, String role) {Config conf = ConfigFactory.parseString("akka.cluster.roles=[" + role + "]").withFallback(ConfigFactory.load());ActorSystem system = ActorSystem.create(systemName, conf);Address realJoinAddress = (joinAddress == null) ? Cluster.get(system).selfAddress() : joinAddress;Cluster.get(system).join(realJoinAddress);system.actorOf(ClusterSingletonManager.defaultProps("active", PoisonPill.getInstance(), role,new ClusterSingletonPropsFactory() {@Overridepublic Props create(Object handOverData) {return Master.props(workTimeout);}}), "master");return realJoinAddress;}public static void startWorker(Address contactAddress) {ActorSystem system = ActorSystem.create(systemName);Set<ActorSelection> initialContacts = new HashSet<ActorSelection>();initialContacts.add(system.actorSelection(contactAddress+ "/user/receptionist"));ActorRef clusterClient = system.actorOf(ClusterClient.defaultProps(initialContacts), "clusterClient");system.actorOf(Worker.props(clusterClient, Props.create(WorkExecutor.class)),"worker");}public static ActorRef startFrontend(Address joinAddress) {ActorSystem system = ActorSystem.create(systemName);Cluster.get(system).join(joinAddress);ActorRef frontend = system.actorOf(Props.create(Frontend.class),"frontend");ActorRef producer = system.actorOf(Props.create(WorkProducer.class, frontend), "producer");system.actorOf(Props.create(WorkResultConsumer.class), "consumer");return producer;}}
--
>>>>>>>>>> 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.
--
>>>>>>>>>> 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.
Here is my configuration.
--
>>>>>>>>>> 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.
I couldn't get your answer. Could you please explain in detail ?
--
>>>>>>>>>> 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.
Thanks for all you help.
--
>>>>>>>>>> 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.
Now all three processes are started (master,worker & frontend) on three different ports. But I am getting the below error.
[INFO] [07/01/2014 00:07:18.695] [Workers-akka.actor.default-dispatcher-4] [akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess] Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp://Workers@172.16.144.66:2552/system/cluster/core/daemon#-450702087] to Actor[akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess#1270182348] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.[INFO] [07/01/2014 00:07:18.699] [Workers-akka.actor.default-dispatcher-7] [akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess] Message [akka.cluster.InternalClusterAction$InitJoinAck] from Actor[akka.tcp://Workers@172.16.144.66:2551/system/cluster/core/daemon#-1993872094] to Actor[akka://Workers/system/cluster/core/daemon/joinSeedNodeProcess#1270182348] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
--
>>>>>>>>>> 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.
--
Hi Patrik,
--
>>>>>>>>>> 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.
Hi Martynas,
--
>>>>>>>>>> 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.
# Settings for the DistributedPubSubExtensionakka.contrib.cluster.pub-sub {# Actor name of the mediator actor, /user/distributedPubSubMediatorname = distributedPubSubMediator# Start the mediator on members tagged with this role.# All members are used if undefined or empty.role = ""# How often the DistributedPubSubMediator should send out gossip informationgossip-interval = 1s# Removed entries are pruned after this durationremoved-time-to-live = 120s}
I'm not sure I understand your problem. You should used something like this:Node 1:akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2551
akka.cluster.seed-nodes = ["akka.tcp://ClusterSystem@127.0.0.1:2551", "akka.tcp://Cluster...@127.0.0.1:2552"]Node 2:akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2552akka.cluster.seed-nodes = ["akka.tcp://ClusterSystem@127.0.0.1:2551", "akka.tcp://Cluster...@127.0.0.1:2552"]Node 3:akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2553akka.cluster.seed-nodes = ["akka.tcp://ClusterSystem@127.0.0.1:2551", "akka.tcp://Cluster...@127.0.0.1:2552"]When you run on multiple machines you should change hostname to the real host name or ip address instead of 127.0.0.1./PatrikOn Fri, Jun 27, 2014 at 6:49 PM, Rohit Kumar <rohitkum...@gmail.com> wrote:
Hi,I am working with akka distributed worker template available on typesafe. I am using it to write a backend job which takes data from siebel using soap calls and inserts in mongo. This job is supposed to run once a week for few hours.Based on the cluster-usage and other documentation on AKKA website, I imported akka-cluster.jar and configured the application configuration file with SEED nodes (akka.cluster.seed-nodes). But when I start the first node (MASTER NODE) with the configuration I mentioned (seed nodes etc), I start getting errors on the server console saying failed to join the seed node which is obvious (as it is the first node and there is nothing to join). Now I start the second node with akka.cluster.seed-nodes configured with the ip-address and port of the process where master node is running. I once again get the errors on the server console.Now what I do next is - take the first join address of the master actor from the MASTER NODE and set it dynamically in the slave node in the code (construct an Address object and pass it to the actors on the slave node). THIS WORKS!!! If I take the same join address and configure it in the application configuration akka.cluster.seed-nodes, it throws me error and slave doesn't join the cluster.So I have following questions :-1. How to configure the akka.cluster.seed-node configuration in application. I could never make it work/count in the configuration.2. Is there any way to pre-configure the seed nodes in the configuration. As per me trying it out, it looks like the configuration is dynamic i.e. to take the join address of actor on the master node from the logs and configure the slave's seed-node configuration with that address ?
--
>>>>>>>>>> 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
With akka-cluster 2.3.11 I seem to be able to have configuration below work as well, contrary to the claim here (https://groups.google.com/forum/#!searchin/akka-user/seed$20node/akka-user/Wehd8AcN1pw/Tc0PYBq2DQAJ) that it doesn't work.
Node 1:akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2551
akka.cluster.seed-nodes = ["akka.tcp://Cluste...@127.0.0.1:2551", "akka.tcp://Cluste...@127.0.0.1:2552"]Node 2:
akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2552
akka.cluster.seed-nodes = ["akka.tcp://Cluste...@127.0.0.1:2552", "akka.tcp://Cluste...@127.0.0.1:2551"]
Is it a fluke? The reason I tried this because I thought if it works it may be more flexible in cases where I don't want to run first seed node which in Patrick's configuration would prevent cluster from initializing.So, if you list all known nodes in seed nodes and first one is always the running node (rather weird) this may allow to start any number of nodes in any order and always guarantee cluster is initialized.Am I missing something here?Thanks,Andre Piwoni
On Sunday, June 29, 2014 at 11:05:45 AM UTC-7, Patrik Nordwall wrote:
I'm not sure I understand your problem. You should used something like this:Node 1:akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2551
akka.cluster.seed-nodes = ["akka.tcp://Cluste...@127.0.0.1:2551", "akka.tcp://Cluste...@127.0.0.1:2552"]Node 2:
akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2552
akka.cluster.seed-nodes = ["akka.tcp://Cluste...@127.0.0.1:2551", "akka.tcp://Cluste...@127.0.0.1:2552"]Node 3:
akka.remote.netty.tcp.hostname = 127.0.0.1akka.remote.netty.tcp.port = 2553
akka.cluster.seed-nodes = ["akka.tcp://Cluste...@127.0.0.1:2551", "akka.tcp://Cluste...@127.0.0.1:2552"]
Visit this group at https://groups.google.com/group/akka-user.