better error handling for nil raftServer

addressing https://github.com/chrislusf/seaweedfs/issues/717
This commit is contained in:
Chris Lu 2019-05-03 22:33:08 -07:00
parent 5681208f2d
commit 3fbe22b203

View file

@ -96,6 +96,9 @@ func runMaster(cmd *Command, args []string) bool {
myMasterAddress, peers := checkPeers(*masterIp, *mport, *masterPeers)
raftServer := weed_server.NewRaftServer(security.LoadClientTLS(viper.Sub("grpc"), "master"),
peers, myMasterAddress, *metaFolder, ms.Topo, *mpulse)
if raftServer == nil {
glog.Fatalf("please verify %s is writable, see https://github.com/chrislusf/seaweedfs/issues/717", *metaFolder)
}
ms.SetRaftServer(raftServer)
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")