我在3个虚拟机上运行Nats流服务器,它们是按照官方NATS文档教程进行集群的。每当文件发生更改时,一个实例就会关闭,然后所有其他实例都会在几分钟后关闭。
已尝试更改某些配置文件,但未成功
# NATS specific configuration
port: 4222
cluster {
listen: 0.0.0.0:6222
routes: ["nats://VM-1-IP:6222", "nats://VM-2-IP:6222"]
}
# NATS Streaming specific configuration
streaming {
id: mycluster
store: file
dir: store
cluster {
node_id: "a"
peers: ["b", "c"]
bootstrap: true
sync: true
# log_path: store
raft_election_timeout: "2s"
raft_lease_timeout: "2s"
}
}例如:有人通过连接到VM-1上发布,VM-1收到消息...片刻之后(可能是在存储消息时),我在一个实例上收到此错误,然后在其他实例上出现相同的错误。
VM-0 Terminal
[10913] 2019/07/18 16:25:43.753835 [INF] VM-0-IP:60063 - rid:12 - Router connection closed
[10913] 2019/07/18 16:25:43.754294 [ERR] VM-0-IP:60063 - rid:12 - attempted to connect to route port
panic: interface conversion: stores.SubStore is *stores.RaftSubStore, not *stores.FileSubStore
goroutine 1477 [running]:
github.com/nats-io/nats-streaming-server/stores.(*FileStore).autoSync(0xc00011e600)
/home/envoy-dns/go/src/github.com/nats-io/nats-streaming-server/stores/filestore.go:1329 +0x33c
created by time.goFunc
/usr/local/go/src/time/sleep.go:169 +0x44
exit status 2发布于 2019-11-23 03:49:30
很抱歉,回复晚了。这是master中的一个bug,但不是任何公开版本中的bug。早在7月份就有了一个修复:https://github.com/nats-io/nats-streaming-server/pull/886
https://stackoverflow.com/questions/57101556
复制相似问题