How to give public IP in configuration file

Hi

Below is my configuration,

remote.netty.tcp {
hostname = 127.0.0.1
port = 2551
}
seed-nodes = [ akka.tcp://ReactorCluster@172.24.116.21:2551", akka.tcp://ReactorCluster@172.24.116.47:2551"]

If I am using public-ip then it starting and connecting with seed nodes but it not working with local-ip address

I don’t want to edit my application.conf on each node of my cluster and set hostname to the external ip of that machine, instead I expected this to work:

Is there any solution to this?

Hi,

Thanks for your question. I don’t recommend ever hard-coding hosts for deployment. If you are not discovering nodes dynamically by service discovery of some sort (see akka-management https://doc.akka.io/docs/akka-management/current/bootstrap/index.html) you can either pass the host/port in by reading from the environment or use Java system properties passed to the JVM on start:

-Dakka.cluster.seed-nodes.0=akka.tcp://ClusterSystem@host1:2552
-Dakka.cluster.seed-nodes.1=akka.tcp://ClusterSystem@host2:2552

Helena