Take a look at:
http://typesafe.com/activator/template/akka-distributed-workers

In the log you posted I see that the problem is that "localhost" is not the
same thing as "127.0.0.1". You must use the hostname you specfied in config
akka.remote.netty.tcp.hostname

/Patrik


On Fri, May 9, 2014 at 3:56 PM, Eugene Dzhurinsky <[email protected]>wrote:

> Hello!
>
> I'm wondering if there's an example of cluster ciient usage available in
> sources? I've read the doc at
> http://doc.akka.io/docs/akka/2.2.3/contrib/cluster-client.html and it's
> not clear how to use that in case if the cient is started in a separate JVM
> outside of a cluster.
>
> For example, I have the following code for the "*front-end*" actor, which
> should be accessible from outside of the cluster, like
>
>   def main(args: Array[String]) {
>     val port = if (args.isEmpty) "0" else args(0)
>     val config =
> ConfigFactory.parseString(s"akka.remote.netty.tcp.port=$port").
>       withFallback(ConfigFactory.parseString("akka.cluster.roles =
> [scheduler]")).
>       withFallback(ConfigFactory.load("application"))
>     val system = ActorSystem("HttpCluster", config)
>     val ref = system.actorOf(Props[TaskSchedulerActor], "scheduler")
>     ClusterReceptionistExtension(system).registerService(ref)
>   }
>
>
> and client code, which actually uses the *front-end*:
>
>     val system = ActorSystem("HttpCluster")
>     val c = system.actorOf(ClusterClient.props(Set(
>       system.actorSelection("akka.tcp://HttpCluster@localhost
> :2551/user/receptionist")
>     )))
>     system.actorOf(Props(new Controller(UUID.randomUUID(), args(0), c)),
> "controller")
>
>
> however this doesn't work, and on side of "front-end" I can see messages
> like
>
> 2014-05-09 09:55:45,567 ERROR  [EndpointWriter] dropping message [class
> akka.actor.ActorSelectionMessage] for non-local recipient
> [Actor[akka.tcp://HttpCluster@localhost:2551/]] arriving at
> [akka.tcp://HttpCluster@localhost:2551] inbound addresses are [akka.tcp://
> [email protected]:2551]
> 2014-05-09 09:55:45,568 ERROR  [EndpointWriter] dropping message [class
> akka.actor.ActorSelectionMessage] for non-local recipient
> [Actor[akka.tcp://HttpCluster@localhost:2551/]] arriving at
> [akka.tcp://HttpCluster@localhost:2551] inbound addresses are [akka.tcp://
> [email protected]:2551]
> 2014-05-09 09:55:48,307 ERROR  [EndpointWriter] dropping message [class
> akka.actor.ActorSelectionMessage] for non-local recipient
> [Actor[akka.tcp://HttpCluster@localhost:2551/]] arriving at
> [akka.tcp://HttpCluster@localhost:2551] inbound addresses are [akka.tcp://
> [email protected]:2551]
> 2014-05-09 09:55:51,306 ERROR  [EndpointWriter] dropping message [class
> akka.actor.ActorSelectionMessage] for non-local recipient
> [Actor[akka.tcp://HttpCluster@localhost:2551/]] arriving at
> [akka.tcp://HttpCluster@localhost:2551] inbound addresses are [akka.tcp://
> [email protected]:2551]
> 2014-05-09 09:55:54,306 ERROR  [EndpointWriter] dropping message [class
> akka.actor.ActorSelectionMessage] for non-local recipient
> [Actor[akka.tcp://HttpCluster@localhost:2551/]] arriving at
> [akka.tcp://HttpCluster@localhost:2551] inbound addresses are [akka.tcp://
> [email protected]:2551]
>
> What do I miss there?
>
> Thanks a lot in advance!
>
> --
> >>>>>>>>>> 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.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw
JOIN US. REGISTER TODAY! <http://www.scaladays.org/>
Scala <http://www.scaladays.org/>
Days <http://www.scaladays.org/>
June 16th-18th, <http://www.scaladays.org/>
Berlin <http://www.scaladays.org/>

-- 
>>>>>>>>>>      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.

Reply via email to