I'm running my two nodes in differents terminals like below : Terminal 1 $ export CLUSTER_IP=127.0.0.1 $ export CLUSTER_PORT=2551 $ sbt runMain WorkersApp
Terminal 2 $ export CLUSTER_IP=127.0.0.1 $ export CLUSTER_PORT=2552 $ sbt runMain WorkersApp I'm running my Akka application using env variables because I want to do the same with docker. But it seems to do not work as I want. Le vendredi 5 mai 2017 20:13:58 UTC+2, Renato Cavalcanti a écrit : > > Your nodes are making a 'cluster' with themselves. This because they are > not getting the IP of each other. > > Are you starting it like that? > > docker run --name seed-1 akka-docker:2.3.4 --seed > docker run --name seed-2 akka-docker:2.3.4 --seed <ip-of-your-seed-1>:2551 > docker run --name node-1 akka-docker:2.3.4 <ip-of-your-seed-1>:2551 > <ip-of-your-seed-2>:2551 > docker run --name node-2 akka-docker:2.3.4 <ip-of-your-seed-1>:2551 > <ip-of-your-seed-2>:2551 > > > ip-of-your-seed must be the IP of the first node you started. > > On Friday, May 5, 2017 at 3:35:39 PM UTC+2, Kilic Ali-Firat wrote: >> >> Hi Akka Team, >> >> To prepare a deployment using docker, I try to start in my laptop a >> cluster with 3 nodes : 2 nodes workers (seed-nodes) and 1 node as cluster >> client. >> >> When I start the first seed node and then second one, this last is not >> joining the cluster as expected. I follow the instructions from akka >> cluster with docker >> <http://www.lightbend.com/activator/template/akka-docker-cluster>. >> >> In the tutorial, the file application.conf do not contains seed-nodes >> because it should be added when the different file configurations have been >> resolved but in my case, I didn't have this impression. >> >> I have the following three files configuration (application.conf, >> node.seed.conf, node.cluster) : >> >> // application.conf >> >> akka { >> remote { >> netty.tcp { >> hostname = ${clustering.ip} >> port = ${clustering.port} >> } >> } >> } >> >> >> clustering { >> port = ${?CLUSTER_PORT} >> ip = ${?CLUSTER_IP} >> cluster.name = "APP" >> } >> >> // node.seed.conf >> akka.cluster { >> seed-nodes += "akka.tcp://"${clustering.cluster.name}"@"${clustering.ip >> }":"${clustering.port} >> roles = [workers] >> } >> >> >> // node.cluster.conf >> akka.cluster { >> seed-nodes += "akka.tcp://"${clustering.cluster.name}"@"${clustering.ip >> }":"${clustering.port} >> roles = [workers] >> } >> >> >> Then I have my Akka application code for running the code of seed-nodes : >> >> >> object WorkersApp extends LazyLogging { >> >> >> def main(args: Array[String]): Unit = { >> >> >> val CLUSTER_NAME_PATH = "clustering.cluster.name" >> >> >> val WORKER_NODE_CONF = "node.seed.conf" >> >> >> lazy val akkaConfig = ConfigFactory.load("application.conf") >> >> >> lazy val actorSystemName = akkaConfig getString CLUSTER_NAME_PATH >> >> >> val actorSystemConfig = >> (ConfigFactory parseResources WORKER_NODE_CONF) >> .withFallback(akkaConfig) >> .resolve() >> >> >> implicit val system = >> ActorSystem(actorSystemName, actorSystemConfig) >> >> >> // Create some actor >> } >> >> When I'm creating the first seed node using CLUSTER_IP=localhost and >> CLUSTER_PORT=2551, I have following logs : >> >> [info] [INFO] [05/05/2017 15:30:51.018] [main] [akka.remote.Remoting] >> Starting remoting >> [info] [INFO] [05/05/2017 15:30:51.127] [main] [akka.remote.Remoting] >> Remoting started; listening on addresses :[akka.tcp://[email protected]:2551] >> [info] [INFO] [05/05/2017 15:30:51.127] [main] [akka.remote.Remoting] >> Remoting now listens on addresses: [akka.tcp://[email protected]:2551] >> [info] [INFO] [05/05/2017 15:30:51.135] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2551] - Starting up... >> [info] [INFO] [05/05/2017 15:30:51.193] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2551] - Registered >> cluster JMX MBean [akka:type=Cluster] >> [info] [INFO] [05/05/2017 15:30:51.193] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2551] - Started up >> successfully >> [info] [INFO] [05/05/2017 15:30:51.213] [FGS-akka.actor.default- >> dispatcher-4] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2551] - Node [akka.tcp://[email protected]:2551] >> is JOINING, roles [workers] >> [info] [INFO] [05/05/2017 15:30:51.223] [FGS-akka.actor.default- >> dispatcher-4] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2551] - Leader is moving node [akka.tcp:// >> [email protected]:2551] to [Up] >> [info] [INFO] [05/05/2017 15:30:51.254] [FGS-akka.actor.default- >> dispatcher-15] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2551] - Metrics will be retreived from MBeans, >> and may be incorrect on some platforms. To increase metric accuracy add the >> 'sigar.jar' to the classpath and the appropriate platform-specific native >> libary to 'java.library.path'. Reason: java.lang.IllegalArgumentException: >> java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getPid()J >> [info] [INFO] [05/05/2017 15:30:51.255] [FGS-akka.actor.default- >> dispatcher-15] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2551] - Metrics collection has started >> successfully >> >> >> >> and then for the second seed node using CLUSTER_IP=localhsot and >> CLUSTER_PORT=2552, I have following logs : >> >> [info] [INFO] [05/05/2017 15:31:48.692] [main] [akka.remote.Remoting] >> Starting remoting >> [info] [INFO] [05/05/2017 15:31:48.803] [main] [akka.remote.Remoting] >> Remoting started; listening on addresses :[akka.tcp://[email protected]:2552] >> [info] [INFO] [05/05/2017 15:31:48.804] [main] [akka.remote.Remoting] >> Remoting now listens on addresses: [akka.tcp://[email protected]:2552] >> [info] [INFO] [05/05/2017 15:31:48.811] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2552] - Starting up... >> [info] [INFO] [05/05/2017 15:31:48.862] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2552] - Registered >> cluster JMX MBean [akka:type=Cluster] >> [info] [INFO] [05/05/2017 15:31:48.862] [main] [akka.cluster.Cluster(akka >> ://FGS)] Cluster Node [akka.tcp://[email protected]:2552] - Started up >> successfully >> [info] [INFO] [05/05/2017 15:31:48.883] [FGS-akka.actor.default- >> dispatcher-2] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2552] - Node [akka.tcp://[email protected]:2552] >> is JOINING, roles [workers] >> [info] [INFO] [05/05/2017 15:31:48.895] [FGS-akka.actor.default- >> dispatcher-2] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2552] - Leader is moving node [akka.tcp:// >> [email protected]:2552] to [Up] >> [info] [INFO] [05/05/2017 15:31:48.924] [FGS-akka.actor.default- >> dispatcher-15] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2552] - Metrics will be retreived from MBeans, >> and may be incorrect on some platforms. To increase metric accuracy add the >> 'sigar.jar' to the classpath and the appropriate platform-specific native >> libary to 'java.library.path'. Reason: java.lang.IllegalArgumentException: >> java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getPid()J >> [info] [INFO] [05/05/2017 15:31:48.925] [FGS-akka.actor.default- >> dispatcher-15] [akka.cluster.Cluster(akka://FGS)] Cluster Node >> [akka.tcp://[email protected]:2552] - Metrics collection has started >> successfully >> >> >> My two seed nodes looks like completely disconnected, the second seed >> node should contact the first seed node but it's not case. >> >> Any advice to solve this issue ? Thanks ! >> >> My two seed nodes looks like completely disconnected Modifier >> >> >> >> -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
