Browse Source

single master mode only when peers is none

pull/7419/head
chrislu 1 month ago
parent
commit
06a99a2110
  1. 4
      weed/command/master.go
  2. 2
      weed/command/server.go

4
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

2
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

Loading…
Cancel
Save