1

我有在 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
4

1 回答 1

0

回复晚了非常抱歉。这是 master 中的一个错误,但在任何公开版本中都没有。7 月份进行了修复:https ://github.com/nats-io/nats-streaming-server/pull/886

于 2019-11-22T19:49:30.390 回答