mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 06:47:24 +08:00
fix: restore raft state
This commit is contained in:
@@ -41,7 +41,7 @@ type MasterOptions struct {
|
||||
disableHttp *bool
|
||||
metricsAddress *string
|
||||
metricsIntervalSec *int
|
||||
removeRaftState *bool
|
||||
raftResumeState *bool
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -60,7 +60,7 @@ func init() {
|
||||
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
|
||||
m.metricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address <host>:<port>")
|
||||
m.metricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds")
|
||||
m.removeRaftState = cmdMaster.Flag.Bool("raft.removeState", true, "remove raft state on start master server")
|
||||
m.raftResumeState = cmdMaster.Flag.Bool("raft.resumeState", false, "resume state of raft on start master server")
|
||||
}
|
||||
|
||||
var cmdMaster = &Command{
|
||||
@@ -121,7 +121,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
||||
}
|
||||
// start raftServer
|
||||
raftServer, err := weed_server.NewRaftServer(security.LoadClientTLS(util.GetViper(), "grpc.master"),
|
||||
peers, myMasterAddress, util.ResolvePath(*masterOption.metaFolder), ms.Topo, 5, *masterOption.removeRaftState)
|
||||
peers, myMasterAddress, util.ResolvePath(*masterOption.metaFolder), ms.Topo, 5, *masterOption.raftResumeState)
|
||||
if raftServer == nil {
|
||||
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user