So, I have same for all noded akka.hocon
, which is copied to every node, and this small part embedded into app.config:
akka.remote.dot-netty.tcp {
hostname = localhost
port = 2552
}
After that I use these as following:
let sys =
let defaultConfig =
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..\\akka.hocon")
|> File.ReadAllText
|> Configuration.parse
ActorSystem.Create("klsrl", Configuration.load().WithFallback(defaultConfig))
To make akka work properly I need to substitute hostname
with a proper IP, specific to every node (because some servers have two network interfaces).
My current idea is to create a file containing hostname -> IP map, pass it to deploy script, which substitutes "localhost" with the proper IP. Is there a better way?
akka.remote.dot-netty.tcp { ... }
string template and passing to Configuration.parse
.
I want to use akka remote, i created 2 Projects with for 2 Nodes. Which have the same configuration except the seed node has fixed port and ip:
akka {
actor.provider = cluster
remote {
dot-netty.tcp {
port = 0
hostname = 0.0.0.0
}
}
cluster {
seed-nodes = ["akka.tcp://TestSystem@192.168.2.111:8383"]
}
}
I also use the same system name but the nodes could not connect to seed no with following error:
Cannot find serializer with id [5]. The most probable reason is that the configuration entry 'akka.actor.serializers' is not in sync between the two systems
What is the problem? Do i need to specify a serializer explicit?