Skip to content

Instantly share code, notes, and snippets.

@tintoy
Created December 24, 2015 09:24
Show Gist options
  • Save tintoy/55bd6121e42a424690da to your computer and use it in GitHub Desktop.
Save tintoy/55bd6121e42a424690da to your computer and use it in GitHub Desktop.
Ok, this is overkill, but HOCON substitutions are nice.
akka {
loggers = [
"akka.event.slf4j.Slf4jLogger"
]
loglevel = warning
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
log-dead-letters = 5
log-dead-letters-during-shutdown = off
remote {
netty.tcp {
hostname = ${primary-cluster.local.ip}
port = ${primary-cluster.local.port}
}
}
cluster {
seed-nodes = [
"akka.tcp://"${primary-cluster.name}"@"${primary-cluster.seed.ip}":"${primary-cluster.seed.port}
]
auto-down-unreachable-after = 10s
}
}
primary-cluster {
name = provisioning-pool
loopback-ip = "127.0.0.1"
default-port = 19123
# The local node's configuration
local {
# Loopback is only used when debugging...
ip = ${primary-cluster.loopback-ip}
# ...otherwise, get the cluster IP from an environment variable.
ip = ${?LOCAL_CLUSTER_IP}
# Our default port.
port = ${primary-cluster.default-port}
# ...but allow override via environment variable.
port = ${?LOCAL_CLUSTER_PORT}
}
# Where to find the cluster seed node.
seed {
# Loopback is only used when debugging...
ip = ${primary-cluster.loopback-ip}
# ...otherwise, if we're the seed node, use the cluster seed IP...
ip = ${?LOCAL_CLUSTER_IP}
# ...but, if we're not the seed node, try to get the seed node's IP address from the environment variable set by Docker's container link.
ip = ${?SEED_PORT_19123_TCP_ADDR}
# Our default port.
port = ${primary-cluster.default-port}
# ...but, if we're not the seed node, try to get the seed node's port from the environment variable set by Docker's container link.
port = ${?SEED_PORT_19123_TCP_PORT}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment