diff --git a/weed/command/master.go b/weed/command/master.go index 2827277c9..e58d60ac3 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -186,7 +186,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { metaDir := path.Join(*masterOption.metaFolder, fmt.Sprintf("m%d", *masterOption.port)) peersString := strings.TrimSpace(*masterOption.peers) - isSingleMaster := peersString == "none" || peersString == "" + isSingleMaster := peersString == "none" raftServerOption := &weed_server.RaftServerOption{ GrpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.master"), @@ -310,7 +310,7 @@ func checkPeers(masterIp string, masterPort int, masterGrpcPort int, peers strin // Handle special case: -peers=none for single-master setup peers = strings.TrimSpace(peers) - if peers == "none" || peers == "" { + if peers == "none" { glog.V(0).Infof("Running in single-master mode (peers=none), no quorum required") cleanedPeers = []pb.ServerAddress{masterAddress} return diff --git a/weed/command/server.go b/weed/command/server.go index 5939d968a..8b47fa4f4 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -238,7 +238,7 @@ func runServer(cmd *Command, args []string) bool { // (checkPeers will be called later in startMaster) peersString := strings.TrimSpace(*masterOptions.peers) if peersString == "none" || peersString == "" { - // Single-master mode: use the current server address + // Single-master mode or no peers specified: use the current server address actualPeersForComponents = util.JoinHostPort(*serverIp, *masterOptions.port) } else { // Multi-master mode: use the provided peers string