How to pass Ip/Port info of all runing services to the Akka node dynamically.

22 views
Skip to first unread message

Nitin Jadon

unread,
Dec 1, 2016, 6:40:21 PM12/1/16
to Akka User List
We are running Akka with Docker image and want to pass all the running Akka Docker's IP/Port info in case of addition on new Docker image.

our application.conf file is defined as per below

 

akka
 
{


 actor
 
{
    provider
= "akka.cluster.ClusterActorRefProvider"
 
 debug
{
              receive
= on
              autoreceive
= on
              lifecycle
= on
              fsm
= on
             
event-stream = on
              unhandled
= on
              router
-misconfiguration = on
           
}
 
}
 
  remote
 
{
    log
-remote-lifecycle-events = off
    netty
.tcp {
      hostname
= "127.0.0.1"
      port
= 2551
   
}
 
}
}

 

We have defined our Java code where we are loading config file using 

 

ActorSystem system = ActorSystem.create("ClusterSystem", config);

 

 

As per current configuration, we are listening to TCP Port. please help to figure out how to pass new docker image IP/Port information to all the current running docker images.  

 

Akka Team

unread,
Dec 12, 2016, 11:52:22 AM12/12/16
to Akka User List
The typesafe config library allows you to override config settings by setting the corresponding system property when you start the JVM, so something like "java my.App -Dakka.remote.netty.tcp.hostname=example.com -cp myjar.jar" but you can also use environment variables if defined in the config. 

See the typesafe config library docs for more info: https://github.com/typesafehub/config#uses-of-substitutions

Note that you will likely have to define the internal ip and port separately from the public ip and port as described here for it to work in Docker: http://doc.akka.io/docs/akka/2.4.14/scala/remoting.html#Remote_Configuration

--
Johan Andrén 
Akka Team

--
>>>>>>>>>> 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+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages