lni / dragonboat

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

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

Closed fishjam closed 10 months ago

fishjam commented 10 months ago

Dragonboat version

v3.3.8

中文

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

lni commented 10 months 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.