creating akka-cluster

3,871 views
Skip to first unread message

Lee Phahladira

unread,
Aug 3, 2013, 5:57:55 PM8/3/13
to akka...@googlegroups.com
Hi

I am very new to akka and would like to use Akka-cluster to build a cluster composed of two kinds of virtual nodes one with the role "front-end" and another with the role "back-end.  Both these nodes will form part of the same cluster and messages will be exchanged between the actors. using the the page provided on http://doc.akka.io/docs/akka/2.1.2/cluster/cluster-usage-scala.html, i came across a few problem when running my code in sbt, this is the error i get:


[error] (run-main) akka.ConfigurationException: ActorSystem [akka://ClusterSystem] needs to have a 'ClusterActorRefProvider' enabled in the configuration, currently uses [akka.actor.LocalActorRefProvider]
akka.ConfigurationException: ActorSystem [akka://ClusterSystem] needs to have a 'ClusterActorRefProvider' enabled in the configuration, currently uses [akka.actor.LocalActorRefProvider]
    at akka.cluster.Cluster.<init>(Cluster.scala:66)
    at akka.cluster.Cluster$.createExtension(Cluster.scala:41)
    at akka.cluster.Cluster$.createExtension(Cluster.scala:36)
    at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:657)
    at akka.actor.ExtensionId$class.apply(Extension.scala:36)
    at akka.cluster.Cluster$.apply(Cluster.scala:36)
    at sample.cluster.simple.SimpleClusterApp$.main(cluster.scala:19)
    at sample.cluster.simple.SimpleClusterApp.main(cluster.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
[trace] Stack trace suppressed: run last compile:run-main for the full output.

I'm not sure if i have to edit my .bashrc  appropriately so that my classpath can read my application.conf file . I don't think my classpath can see the config file. how do I fix this problem ?Your help will be highly appreciated.

Thanks
Lee
---

Chaitanya Sharma

unread,
Aug 4, 2013, 2:32:01 PM8/4/13
to akka...@googlegroups.com
Since you are running from sbt console, it should have application.conf in the classpath.
Make sure, you have ClusterActorRefProvider defined for the akka actor provider.


  1. akka {
  2. actor {
  3. provider = "akka.cluster.ClusterActorRefProvider"
  4. }


- Chaitanya




--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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/groups/opt_out.
 
 

Akka Team

unread,
Aug 6, 2013, 1:51:40 AM8/6/13
to akka...@googlegroups.com
Hi Lee,

how do you start your JVM? Normally .bashrc is not where you would put this, but the possibilities are literally endless, so we will need more info in order to help you.

Regards,

Roland
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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/groups/opt_out.
 
 


--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

Lee Phahladira

unread,
Aug 6, 2013, 3:26:00 PM8/6/13
to akka...@googlegroups.com
Hi Roland

well im not sure if I get your question, but  I start my JVM normally using the javac command.
I have specified in my .bashrc file the exact location where the JVM should find the libraries as follows:

CLASSPATH=$CLASSPATH:/usr/share/java
export CLASSPATH

using my src/main/resources/application.conf file, I aim to configure the cluster in this way:

    1. akka {
    2. actor {
    3. provider = "akka.cluster.ClusterActorRefProvider"
    4. }
    1. remote {
    2. transport = "akka.remote.netty.NettyRemoteTransport"
    3. log-remote-lifecycle-events = off
    4. netty {
    5. hostname = "127.0.0.1"
    6. port = 0
    7. }
    8. }
    9.  
    10. cluster {
    11. seed-nodes = [
    12. "akka://Cluste...@127.0.0.1:2551",
    13. "akka://Cluste...@127.0.0.1:2552"]
    14.  
    15. auto-down = on
    16. }
    17. }
    But I keep getting the  same error regardless of the path I specify in my .bashrc file.
    Please help.

    Akka Team

    unread,
    Aug 8, 2013, 2:42:14 AM8/8/13
    to akka...@googlegroups.com
    Hi Lee,

    javac is the Java compiler, you probably mean “java”. What you normally do is

    java -classpath /path/to/my.jar com.example.MyMainClass <arguments>

    and here you need to make sure that the classpath contains the directory where your application.conf is stored, e.g. by appending “:.” in the example above (if the config is in the current working directory). This question is not specific to akka though, and I encourage you to read up on how to run Java applications in general.

    Regards,

    Roland
    --
    >>>>>>>>>> Read the docs: http://akka.io/docs/
    >>>>>>>>>> Check the FAQ: http://akka.io/faq/
    >>>>>>>>>> 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/groups/opt_out.
     
     

    leopard...@gmail.com

    unread,
    Jun 2, 2015, 4:30:03 AM6/2/15
    to akka...@googlegroups.com
    Hi Roland, 
    We got similar situation too. We have two kind of cluster now, one is using AKKA 2.3.5, the other one is using AKKA 2.3.8. Here is my exception stack: 
    2015-06-02 12:12:58,054 INFO [application-akka.actor.default-dispatcher-2] Remoting Remoting now listens on addresses: [akka.tcp://appli...@172.19.0.59:51039]
    Oops, cannot start the server.
    akka.ConfigurationException: ActorSystem [akka://application] needs to have a 'ClusterActorRefProvider' enabled in the configuration, currently uses [akka.remote.RemoteActorRefProvider]
            at akka.cluster.Cluster.<init>(Cluster.scala:79)
            at akka.cluster.Cluster$.createExtension(Cluster.scala:42)
            at akka.cluster.Cluster$.createExtension(Cluster.scala:37)
            at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:711)
            at akka.actor.ExtensionId$class.apply(Extension.scala:79)
            at akka.cluster.Cluster$.apply(Cluster.scala:37)
            at akka.contrib.pattern.ClusterReceptionistExtension.isTerminated(ClusterClient.scala:221)
            at akka.contrib.pattern.ClusterReceptionistExtension.<init>(ClusterClient.scala:263)
            at akka.contrib.pattern.ClusterReceptionistExtension$.createExtension(ClusterClient.scala:206)
            at akka.contrib.pattern.ClusterReceptionistExtension$.createExtension(ClusterClient.scala:200)
            at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:711)
            at akka.actor.ActorSystemImpl$$anonfun$loadExtensions$1.apply(ActorSystem.scala:740)
            at akka.actor.ActorSystemImpl$$anonfun$loadExtensions$1.apply(ActorSystem.scala:738)
            at scala.collection.Iterator$class.foreach(Iterator.scala:727)
            at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
            at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
            at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
            at akka.actor.ActorSystemImpl.loadExtensions(ActorSystem.scala:738)
            at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:621)
            at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:615)
            at akka.actor.ActorSystemImpl._start(ActorSystem.scala:615)
            at akka.actor.ActorSystemImpl.start(ActorSystem.scala:632)
            at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
            at akka.actor.ActorSystem$.apply(ActorSystem.scala:125)
            at play.api.libs.concurrent.AkkaPlugin$$anon$1.create(Akka.scala:44)
            at play.core.ClosableLazy.get(ClosableLazy.scala:51)
            at play.api.libs.concurrent.AkkaPlugin.applicationSystem(Akka.scala:71)
            at play.api.libs.concurrent.Akka$$anonfun$system$1.apply(Akka.scala:29)
            at play.api.libs.concurrent.Akka$$anonfun$system$1.apply(Akka.scala:29)
            at scala.Option.map(Option.scala:145)
            at play.api.libs.concurrent.Akka$.system(Akka.scala:29)
            at play.api.libs.concurrent.Akka.system(Akka.scala)
            at play.libs.Akka.system(Akka.java:25)
            at com.kaiyuan.platform.api.common.integration.core.impl.APICoreSystemSettings.registerLifecycleMonitor(APICoreSystemSettings.java:33)
            at com.kaiyuan.platform.common.integration.core.ComponentAccessStore.<init>(ComponentAccessStore.java:114)
            at com.kaiyuan.platform.api.common.integration.core.impl.CoreAccessImpl.<init>(CoreAccessImpl.java:42)
            at com.kaiyuan.platform.api.common.application.APIGlobalSettings.onStart(APIGlobalSettings.java:61)
            at com.kaiyuan.platform.api.banking.application.BankingGlobalSettings.onStart(BankingGlobalSettings.java:35)
            at play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22)
            at play.api.GlobalPlugin.onStart(GlobalSettings.scala:220)
            at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
            at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
            at scala.collection.immutable.List.foreach(List.scala:318)
            at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
            at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
            at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
            at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
            at play.api.Play$.start(Play.scala:90)
            at play.core.StaticApplication.<init>(ApplicationProvider.scala:55)
            at play.core.server.NettyServer$.createServer(NettyServer.scala:244)
            at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:280)
            at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:275)
            at scala.Option.map(Option.scala:145)
            at play.core.server.NettyServer$.main(NettyServer.scala:275)
            at play.core.server.NettyServer.main(NettyServer.scala)

    We have 8 different services install on same machine, and using similar way to start it. But we found only two of our service can`t be started and we got above problem. 

    I am grad to receive advice from your side.

    BRs,
    James

    在 2013年8月8日星期四 UTC+8下午2:42:14,Akka Team写道:
    To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@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/groups/opt_out.
     
     

    Akka Team

    unread,
    Jun 2, 2015, 5:14:18 AM6/2/15
    to Akka User List
    Hi,

    There are two possible reasons for the above failure:
     A: the application is not properly configured to use the ClusterActorRefProvider
     B: the configuration is correct, but the "application.conf" configuration file is not on the classpath

    You should either check your classpath, or you can alternatively load the configuration explicitly, passing it to the ActorSystem during creation.

    -Endre

    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/groups/opt_out.
     
     


    --
    Akka Team
    Typesafe - The software stack for applications that scale
    Blog: letitcrash.com
    Twitter: @akkateam

    --
    >>>>>>>>>> Read the docs: http://akka.io/docs/

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



    --
    Akka Team
    Typesafe - Reactive apps on the JVM
    Blog: letitcrash.com
    Twitter: @akkateam

    leopard...@gmail.com

    unread,
    Jun 11, 2015, 6:30:16 PM6/11/15
    to akka...@googlegroups.com
    Hi Endre,
    We still have this problem, could you provide your Skype user name, in this case, we could provide more detailed information about this problem.

    BRs,
    James

    在 2015年6月2日星期二 UTC+8下午5:14:18,Akka Team写道:
    Hi,

    There are two possible reasons for the above failure:
     A: the application is not properly configured to use the ClusterActorRefProvider
     B: the configuration is correct, but the "application.conf" configuration file is not on the classpath

    You should either check your classpath, or you can alternatively load the configuration explicitly, passing it to the ActorSystem during creation.

    -Endre
    On Tue, Jun 2, 2015 at 6:37 AM, <leopard...@gmail.com> wrote:
    Hi Roland, 
    We got similar situation too. We have two kind of cluster now, one is using AKKA 2.3.5, the other one is using AKKA 2.3.8. Here is my exception stack: 
    2015-06-02 12:12:58,054 INFO [application-akka.actor.default-dispatcher-2] Remoting Remoting now listens on addresses: [akka.tcp://application@172.19.0.59:51039]
    To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@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/groups/opt_out.
     
     


    --
    Akka Team
    Typesafe - The software stack for applications that scale
    Blog: letitcrash.com
    Twitter: @akkateam

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

    Roland Kuhn

    unread,
    Jun 12, 2015, 5:12:40 PM6/12/15
    to akka-user
    Hi James,

    for commercial support please contact Typesafe support (if you already have a subscription) or in...@typesafe.com (if you do not).

    Regards,

    Roland


    Dr. Roland Kuhn
    Akka Tech Lead
    Typesafe – Reactive apps on the JVM.
    twitter: @rolandkuhn


    Reply all
    Reply to author
    Forward
    0 new messages