【发布时间】:2019-11-11 04:46:41
【问题描述】:
我有一个想要在集群中运行的 PlayFramework (play-scala) 应用程序。所以我可能有几个这个应用程序镜像的 docker 容器正在运行。我不提前知道这些IP地址,因为云服务提供商可以动态启动和停止它们,所以我无法指定种子节点。此外,对于应用程序的每个实例,所有application.conf 文件都应该相同吗?
如何配置 play 应用程序以使应用程序的每个实例都能发现并加入 Akka 集群?
我看过: https://www.playframework.com/documentation/2.7.x/ScalaAkka#Akka-Cluster Akka cluster setup with play framework https://github.com/lregnier/play-akka-cluster-aws
我是否必须使用Akka Cluster Bootstrap,因为我无法指定种子节点?
application.conf 文件中是否有以下内容(取自Cluster Usage:
akka {
actor {
provider = "cluster"
}
remote {
log-remote-lifecycle-events = off
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://ClusterSystem@127.0.0.1:2551",
"akka.tcp://ClusterSystem@127.0.0.1:2552"]
# auto downing is NOT safe for production deployments.
# you may want to use it during development, read more about it in the docs.
#
# auto-down-unreachable-after = 10s
}
}
但是没有种子节点?如果是,节点如何发现并加入集群?
【问题讨论】:
标签: playframework akka akka-cluster