Question

I'm trying to create a basic akka cluster on a Win 7 machine from this documentation:
http://doc.akka.io/docs/akka/snapshot/scala/cluster-usage.html

and I'm getting an error when I run the seed nodes (more on them below)

AdriansClusterSystem-akka.actor.default-dispa tcher-16] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWr iter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2552-3/endpointWriter] dropping message [class akka.actor.SelectChildName] for non-local recipient [Act or[akka.tcp://ClusterSystem@127.0.0.1:2552/]] arriving at [akka.tcp://ClusterSys tem@127.0.0.1:2552] inbound addresses are [akka.tcp://AdriansClusterSystem@127.0 .0.1:2552]

Question: Why am I getting this error? Did I miss something from the akka documentation?

My .conf file:
I added this extra line *To the file listed at the URL above * enabled-transports = ["akka.remote.netty.tcp"]

akka {
  actor {
    provider = "akka.cluster.ClusterActorRefProvider"
  }
  remote {
    enabled-transports = ["akka.remote.netty.tcp"]  <--added this from remoting
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "127.0.0.1"
      port = 0
    }
  }
  cluster {
    seed-nodes = [
    "akka.tcp://ClusterSystem@127.0.0.1:2551",
    "akka.tcp://ClusterSystem@127.0.0.1:2552"]

  auto-down = on
  }
}

I start the 2 nodes, each in different sbt windows

run-main sample.cluster.simple.SimpleClusterApp 2551  
run-main sample.cluster.simple.SimpleClusterApp 2552

Both of these start up fine then repeatedly show an ERROR message:

mybuild:-:0.0.1-SNAPSHOT>`run-main sample.cluster.simple.SimpleClusterApp 2552`
[warn] Credentials file C:\Users\amocanu\.ivy2\.credentials does not exist  <-- ?
[info] Running sample.cluster.simple.SimpleClusterApp 2552
 args[0]= 2552
[INFO] [07/31/2013 10:50:00.397] [run-main] [Remoting] Starting remoting
[INFO] [07/31/2013 10:50:00.661] [run-main] [Remoting] Remoting started; listeni
ng on addresses :[akka.tcp://AdriansClusterSystem@127.0.0.1:2552]
[INFO] [07/31/2013 10:50:00.710] [run-main] [Cluster(akka://AdriansClusterSystem
)] Cluster Node [akka.tcp://AdriansClusterSystem@127.0.0.1:2552] - Starting up..
.
[INFO] [07/31/2013 10:50:00.823] [run-main] [Cluster(akka://AdriansClusterSystem
)] Cluster Node [akka.tcp://AdriansClusterSystem@127.0.0.1:2552] - Registered cl
uster JMX MBean [akka:type=Cluster]
[INFO] [07/31/2013 10:50:00.823] [run-main] [Cluster(akka://AdriansClusterSystem
)] Cluster Node [akka.tcp://AdriansClusterSystem@127.0.0.1:2552] - Started up su
ccessfully
[INFO] [07/31/2013 10:50:00.868] [AdriansClusterSystem-akka.actor.default-dispat
cher-2] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC
lusterSystem@127.0.0.1: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.libr
ary.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar
[INFO] [07/31/2013 10:50:00.874] [AdriansClusterSystem-akka.actor.default-dispat
cher-2] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC
lusterSystem@127.0.0.1:2552] - Metrics collection has started successfully
[INFO] [07/31/2013 10:50:00.883] [AdriansClusterSystem-akka.actor.default-dispat
cher-13] [akka://AdriansClusterSystem/user/clusterListener] Current members:
[ERROR] [07/31/2013 10:50:01.003] [AdriansClusterSystem-akka.actor.default-dispa
tcher-3] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWri
ter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2551-0/endpointWriter] d
ropping message [class akka.actor.SelectChildName] for non-local recipient [Acto
r[akka.tcp://ClusterSystem@127.0.0.1:2552/]] arriving at [akka.tcp://ClusterSyst
em@127.0.0.1:2552] inbound addresses are [akka.tcp://AdriansClusterSystem@127.0.
0.1:2552]
[ERROR] [07/31/2013 10:50:01.009] [AdriansClusterSystem-akka.actor.default-dispa
tcher-16] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWr
iter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2552-3/endpointWriter]
dropping message [class akka.actor.SelectChildName] for non-local recipient [Act
or[akka.tcp://ClusterSystem@127.0.0.1:2552/]] arriving at [akka.tcp://ClusterSys
tem@127.0.0.1:2552] inbound addresses are [akka.tcp://AdriansClusterSystem@127.0
.0.1:2552]

If now I do

run-main sample.cluster.simple.SimpleClusterApp

which is supposed to choose a random port and run a seed node on, it starts of well just as the other 2 seed nodes, then shows a class not found exception as INFO and no current members

[INFO] [07/31/2013 11:19:36.612] [AdriansClusterSystem-akka.actor.default-dispat
cher-3] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC
lusterSystem@127.0.0.1:54824] - Metrics will be retreived from MBeans, and may b
e incorrect on some platforms. To increase metric accuracy add the 'sigar.jar' t
o the classpath and the appropriate platform-specific native libary to 'java.lib
rary.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar
[INFO] [07/31/2013 11:19:36.619] [AdriansClusterSystem-akka.actor.default-dispat
cher-3] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC
lusterSystem@127.0.0.1:54824] - Metrics collection has started successfully
[INFO] [07/31/2013 11:19:36.633] [AdriansClusterSystem-akka.actor.default-dispat
cher-12] [akka://AdriansClusterSystem/user/clusterListener] Current members:

Yup it just hangs there and I have to close the sbt window to terminate it.

Was it helpful?

Solution

It looks like your seed nodes are using ClusterSystem as the actor system name but according to your logs you are using AdriansClusterSystem as your actor system name. Try changing the seed nodes to:

seed-nodes = [
"akka.tcp://AdriansClusterSystem@127.0.0.1:2551",
"akka.tcp://AdriansClusterSystem@127.0.0.1:2552"]

OTHER TIPS

For the benefit of searchers...

Firstly, check the accepted answer from @cmbaxter.

However, if that fails:

  • Run your cluster and copy the address of the seed node e.g. akka.tcp://ClusterSystem@localhost:8092/system/endpointManager/...

  • Now check the address in the error e.g. Dropping message [Akka.Actor.ActorSelectionMessage] for non-local recipient [[akka.tcp://ClusterSystem@127.0.0.1:8092/]]

In my case, ClusterSystem was set up on localhost, but the calling code was calling 127.0.0.1.

Setting client and cluster (including seed-nodes) to the same address fixed it (I set both to 127.0.0.1)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top