在将Akka.NET用于可伸缩应用程序的过程中,我正在尝试设置Lighthouse种子节点的集群。我正在测试3个Lighthouse节点作为种子节点,每个节点都在具有不同端口的同一台计算机上运行。以下是我的hocon配置示例:
lighthouse.actorsystem: "my-system"
# See petabridge.cmd configuration options here: https://cmd.petabridge.com/articles/install/host-configuration.html
petabridge.cmd.host = "0.0.0.0"
petabridge.cmd.port = 9111/9112/9113 #one in each node
akka.actor.provider = cluster
akka.remote.log-remote-lifecycle-events = DEBUG
akka.remote.dot-netty.tcp.transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
akka.remote.dot-netty.tcp.applied-adapters = []
akka.remote.dot-netty.tcp.transport-protocol = tcp
akka.remote.dot-netty.tcp.public-hostname = "localhost"
akka.remote.dot-netty.tcp.hostname = "localhost"
akka.remote.dot-netty.tcp.port = 4001/4002/4003
akk.cluster.seed-nodes = ["akka.tcp://my-system@localhost:4001","akka.tcp://my-system@localhost:4002","akka.tcp://my-system@localhost:4003"]
akk.cluster.roles = [lighthouse]
如果我从3个命令提示符启动这些节点,则每个节点都会打印以下消息:
[INFO][22-01-2019 11:45:17][Thread 0020][Cluster] Cluster Node [akka.tcp://my-system@localhost:4001/4002/4003] - Node [akka.tcp://my-system@localhost:4001/4002/4003] is JOINING itself (with roles []) and forming a new cluster
[INFO][22-01-2019 11:45:17][Thread 0020][Cluster] Cluster Node [akka.tcp://my-system@localhost:4001/4002/4003] - Leader is moving node [akka.tcp://my-system@localhost:4001/4002/4003] to [Up]
在这里,我担心的是,根据打印的日志,这三个实例没有形成集群,并且似乎正在形成三个单独的集群,因为节点本身未获得有关其他Lighthouse节点的任何消息。
有人可以澄清这是否是预期的行为,因为似乎没有在线示例。