|
@ -41,7 +41,7 @@ type MasterOptions struct { |
|
|
disableHttp *bool |
|
|
disableHttp *bool |
|
|
metricsAddress *string |
|
|
metricsAddress *string |
|
|
metricsIntervalSec *int |
|
|
metricsIntervalSec *int |
|
|
removeRaftState *bool |
|
|
|
|
|
|
|
|
raftResumeState *bool |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
@ -60,7 +60,7 @@ func init() { |
|
|
m.disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.") |
|
|
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.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.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{ |
|
|
var cmdMaster = &Command{ |
|
@ -121,7 +121,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { |
|
|
} |
|
|
} |
|
|
// start raftServer
|
|
|
// start raftServer
|
|
|
raftServer, err := weed_server.NewRaftServer(security.LoadClientTLS(util.GetViper(), "grpc.master"), |
|
|
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 { |
|
|
if raftServer == nil { |
|
|
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err) |
|
|
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717: %s", *masterOption.metaFolder, err) |
|
|
} |
|
|
} |
|
|