我们的集群在本地运行(目前),一切似乎都配置正确。我们的主要计算消息分布在我们的种子节点上。但是,我们会间歇性地丢失消息。您可以在屏幕截图中看到两次运行的行为。哪些消息被标记为死信完全不一致。
我们的消息总是以相同的方式发送,它们看起来像这样。最后一个参数表示要找到的第 n 个素数。
new PrimeCalculationEntry(id, 1, 100000),
new PrimeCalculationEntry(id, 2, 150000),
new PrimeCalculationEntry(id, 3, 200000),
new PrimeCalculationEntry(id, 4, 250000),
new PrimeCalculationEntry(id, 5, 300000),
new PrimeCalculationEntry(id, 6, 350000),
new PrimeCalculationEntry(id, 7, 400000),
new PrimeCalculationEntry(id, 8, 450000)
我们的集群是这样设置的:一个非种子节点,它是一个组路由器,向两个种子节点发送消息,这两个种子节点被配置为池路由器。
非种子节点:localhost:0(随机端口)
akka {
actor {
provider = cluster
deployment {
/commander {
router = round-robin-group # routing strategy
routees.paths = ["/user/cluster"] # path of routee on each node
cluster {
enabled = on
allow-local-routees = on
}
}
}
}
remote {
dot-netty.tcp {
port = 0 #let os pick random port
hostname = localhost
}
}
cluster {
seed-nodes = ["akka.tcp://ClusterSystem@localhost:8081", "akka.tcp://ClusterSystem@localhost:8082"]
}
}
种子节点 1: localhost:8081 (leader)
akka {
actor {
provider = cluster
deployment {
/cluster {
router = round-robin-pool
nr-of-instances = 10
}
}
}
remote {
dot-netty.tcp {
port = 8081
hostname = localhost
}
}
cluster {
seed-nodes = ["akka.tcp://ClusterSystem@localhost:8081"]
}
}
种子节点 2:本地主机:8082
akka {
actor {
provider = cluster
deployment {
/cluster {
router = round-robin-pool
nr-of-instances = 10
}
}
}
remote {
dot-netty.tcp {
port = 8082
hostname = localhost
}
}
cluster {
seed-nodes = ["akka.tcp://ClusterSystem@localhost:8081"]
}
}
谁能指出我们正确的方向?我们的配置有问题吗?先感谢您。