Hello!
I'm trying to start 2 nodes in a cluster - one with role "http" and another
one with role "chunk" role. Initially there are no actors running at the
"http" node (ones should be deployed when node "chunk" joins the cluster)
my application.conf:
akka {
actor {
provider = "akka.cluster.ClusterActorRefProvider"
deployment {
/my_service/router_httpworker {
router = consistent-hashing-pool
nr-of-instances = 10
routees.paths = ["/user/httpworker"]
cluster {
enabled = on
max-nr-of-instances-per-node = 5
allow-local-routees = on
}
}
}
}
remote {
log-remote-lifecycle-events = off
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551"]
auto-down-unreachable-after = 10s
}
extensions = ["akka.contrib.pattern.ClusterReceptionistExtension"]
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
}
the code HTTP worker service:
object Http {
def main(args: Array[String]) {
val config =
ConfigFactory.parseString(s"akka.remote.netty.tcp.port=0").
withFallback(ConfigFactory.parseString("akka.cluster.roles =
[http]")).
withFallback(ConfigFactory.load("application"))
ActorSystem("HttpCluster", config)
}
}
the code for the "chunk" service:
object Chunk {
def main(args: Array[String]) {
val config =
ConfigFactory.parseString(s"akka.remote.netty.tcp.port=2551").
withFallback(ConfigFactory.parseString("akka.cluster.roles =
[chunk]")).
withFallback(ConfigFactory.load("application"))
val system = ActorSystem("HttpCluster", config)
system.actorOf(Props[TaskChunkActor].withRouter(RoundRobinPool(4)),
"chunk")
val ref = system.actorOf(Props[MyRef])
Thread.sleep(1000)
system.actorSelection("/my_service/router_httpworker").tell("123",
ref)
}
class MyRef extends Actor {
override def receive = {
case msg ⇒ println(msg)
}
}
}
in the logs I can see:
2014-05-14 23:00:37,136 INFO [EmptyLocalActorRef] Message
[java.lang.String] from Actor[akka://HttpCluster/user/$a#-289938669] to
Actor[akka://HttpCluster/my_service/router_httpworker] 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'.
So it seems that the router is not started? As far as I understood from the
tutorial, the router should be started upon cluster startup, am I wrong?
--
>>>>>>>>>> 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.