lni / dragonboat

A feature complete and high performance multi-group Raft library in Go.
Apache License 2.0
5.09k stars 542 forks source link

how to know the cluster is first create or recovery? #333

Closed fishjam closed 1 year ago

fishjam commented 1 year ago

Dragonboat version

v3.3.8

中文

你好, 我想问一下, 在调用 NodeHost.StartCluster 后, 怎么知道该 Cluster 是 第一次启动, 还是停止后重新启动?

lni commented 1 year ago

It is your application's responsibility to keep such info, e.g. just create a flag file on the local disk next to the Nodehost folder to record when the shard is first created.