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/volume.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/volume.go')
| -rw-r--r-- | weed/command/volume.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go index df67bf447..f3b36fcda 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -74,7 +74,7 @@ func init() { v.publicPort = cmdVolume.Flag.Int("port.public", 0, "port opened to public") v.ip = cmdVolume.Flag.String("ip", util.DetectedHostAddress(), "ip or server name, also used as identifier") v.publicUrl = cmdVolume.Flag.String("publicUrl", "", "Publicly accessible address") - v.bindIp = cmdVolume.Flag.String("ip.bind", "", "ip address to bind to") + v.bindIp = cmdVolume.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.") v.mastersString = cmdVolume.Flag.String("mserver", "localhost:9333", "comma-separated master servers") v.preStopSeconds = cmdVolume.Flag.Int("preStopSeconds", 10, "number of seconds between stop send heartbeats and stop volume server") // v.pulseSeconds = cmdVolume.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats, must be smaller than or equal to the master's setting") @@ -193,6 +193,9 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v *v.ip = util.DetectedHostAddress() glog.V(0).Infof("detected volume server ip address: %v", *v.ip) } + if *v.bindIp == "" { + *v.bindIp = *v.ip + } if *v.publicPort == 0 { *v.publicPort = *v.port |
