Browse Source

better error handling for nil raftServer

addressing https://github.com/chrislusf/seaweedfs/issues/717
pull/991/head
Chris Lu 6 years ago
parent
commit
3fbe22b203
  1. 3
      weed/command/master.go

3
weed/command/master.go

@ -96,6 +96,9 @@ func runMaster(cmd *Command, args []string) bool {
myMasterAddress, peers := checkPeers(*masterIp, *mport, *masterPeers) myMasterAddress, peers := checkPeers(*masterIp, *mport, *masterPeers)
raftServer := weed_server.NewRaftServer(security.LoadClientTLS(viper.Sub("grpc"), "master"), raftServer := weed_server.NewRaftServer(security.LoadClientTLS(viper.Sub("grpc"), "master"),
peers, myMasterAddress, *metaFolder, ms.Topo, *mpulse) 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) ms.SetRaftServer(raftServer)
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET") r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")

Loading…
Cancel
Save