diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-20 14:05:59 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-20 14:05:59 -0700 |
| commit | 52fe86df4517c285014cb9f652126f2cc0eca130 (patch) | |
| tree | 476901f338094993bbf0d10b51492da7164300db /weed/command/master.go | |
| parent | fa7c65bd4bf431d285c093a5674c43b5763a653a (diff) | |
| download | seaweedfs-52fe86df4517c285014cb9f652126f2cc0eca130.tar.xz seaweedfs-52fe86df4517c285014cb9f652126f2cc0eca130.zip | |
use default 10000 for grpc port
Diffstat (limited to 'weed/command/master.go')
| -rw-r--r-- | weed/command/master.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/command/master.go b/weed/command/master.go index adc9055ea..fc3e41d8d 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -47,7 +47,7 @@ type MasterOptions struct { func init() { cmdMaster.Run = runMaster // break init cycle m.port = cmdMaster.Flag.Int("port", 9333, "http listen port") - m.portGrpc = cmdMaster.Flag.Int("port.grpc", 19333, "grpc listen port") + m.portGrpc = cmdMaster.Flag.Int("port.grpc", 0, "grpc listen port") m.ip = cmdMaster.Flag.String("ip", util.DetectedHostAddress(), "master <ip>|<server> address, also used as identifier") m.ipBind = cmdMaster.Flag.String("ip.bind", "", "ip address to bind to") m.metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data") @@ -113,6 +113,10 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { backend.LoadConfiguration(util.GetViper()) + if *masterOption.portGrpc == 0 { + *masterOption.portGrpc = 10000 + *masterOption.port + } + myMasterAddress, peers := checkPeers(*masterOption.ip, *masterOption.port, *masterOption.portGrpc, *masterOption.peers) r := mux.NewRouter() |
