diff options
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) |
