diff options
| author | chrislu <chris.lu@gmail.com> | 2022-03-11 14:02:39 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-03-11 14:02:39 -0800 |
| commit | 3a6eb8ca5ff6a8f3fbe76933847c0b804c26ba2a (patch) | |
| tree | 18447926c32f7a8a7673137cb4d9bdd2fdc87845 /weed/command/master_follower.go | |
| parent | 728bf50a731c2a171e4ca969f474a5565160a53a (diff) | |
| download | seaweedfs-3a6eb8ca5ff6a8f3fbe76933847c0b804c26ba2a.tar.xz seaweedfs-3a6eb8ca5ff6a8f3fbe76933847c0b804c26ba2a.zip | |
default bind to one ip address
fix https://github.com/chrislusf/seaweedfs/issues/1937
Diffstat (limited to 'weed/command/master_follower.go')
| -rw-r--r-- | weed/command/master_follower.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/command/master_follower.go b/weed/command/master_follower.go index 6d7aa2848..2c71b34d5 100644 --- a/weed/command/master_follower.go +++ b/weed/command/master_follower.go @@ -24,7 +24,7 @@ func init() { cmdMasterFollower.Run = runMasterFollower // break init cycle mf.port = cmdMasterFollower.Flag.Int("port", 9334, "http listen port") mf.portGrpc = cmdMasterFollower.Flag.Int("port.grpc", 0, "grpc listen port") - mf.ipBind = cmdMasterFollower.Flag.String("ip.bind", "", "ip address to bind to") + mf.ipBind = cmdMasterFollower.Flag.String("ip.bind", "", "ip address to bind to. Default to localhost.") mf.peers = cmdMasterFollower.Flag.String("masters", "localhost:9333", "all master nodes in comma separated ip:port list, example: 127.0.0.1:9093,127.0.0.1:9094,127.0.0.1:9095") mf.ip = aws.String(util.DetectedHostAddress()) @@ -111,6 +111,10 @@ func startMasterFollower(masterOptions MasterOptions) { option := masterOptions.toMasterOption(nil) option.IsFollower = true + if *masterOptions.ipBind == "" { + *masterOptions.ipBind = "localhost" + } + r := mux.NewRouter() ms := weed_server.NewMasterServer(r, option, masters) listeningAddress := util.JoinHostPort(*masterOptions.ipBind, *masterOptions.port) |
