I am working with akka clustering and trying to setup two different configs for different environments.
- one for my local setup where I would be using seed nodes to start up my application
- two for my production Kubernetes setup.
I tried the Config Docs from Akka that mention about the -Dconfig.resource=/dev.conf
and include application
in the conf files but it still keep asking for akka.discovery.method
in application.conf
Below are my two config files:
application.conf
akka {
log-config-on-start = off
stdout-loglevel = "DEBUG"
loglevel = "INFO"
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
log-dead-letters = on
log-dead-letters-during-shutdown = off
actor {
provider = "cluster"
}
cluster {
down-removal-margin = 7s
sharding {
least-shard-allocation-strategy {
rebalance-threshold = 1
max-simultaneous-rebalance = 5
}
}
}
}
akka.http.server.idle-timeout = 900s
akka.http.client.idle-timeout = 900s
application-seed.conf
include "application"
akka {
actor {
provider = "cluster"
serializers {
jackson-json = "akka.serialization.jackson.JacksonJsonSerializer"
}
}
discovery.method = config
remote.artery {
canonical {
hostname = "127.0.0.1"
port = 2551
}
}
cluster {
seed-nodes = [
"akka://MyCluster@127.0.0.1:2551"]
}
}
When I run the code with the parameter:
-D config.resource=/application-seed.conf
it throws me the error:
No default service discovery implementation configured in
akka.discovery.method
. Make sure to configure this setting to your preferred implementation such as 'akka-dns' in your application.conf (from the akka-discovery module).
Has anyone done this kind of a setup before?