aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-21 14:21:06 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-21 14:21:06 -0700
commitcf54d703114256f439edf3b16a69d9ff8bd85aec (patch)
tree5e468e65ba80a675b52cdb50c761e5266e178e1f /weed/command/filer.go
parent5c348087dc0dd9a67250f80839908b22000a5591 (diff)
downloadseaweedfs-cf54d703114256f439edf3b16a69d9ff8bd85aec.tar.xz
seaweedfs-cf54d703114256f439edf3b16a69d9ff8bd85aec.zip
filer: add -ip.bind option
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index ce6d79a17..203164d65 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -23,6 +23,7 @@ var (
type FilerOptions struct {
masters *string
ip *string
+ bindIp *string
port *int
publicPort *int
collection *string
@@ -44,6 +45,7 @@ func init() {
f.masters = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this collection")
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
+ f.bindIp = cmdFiler.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
f.publicPort = cmdFiler.Flag.Int("port.readonly", 0, "readonly port opened to public")
f.defaultReplicaPlacement = cmdFiler.Flag.String("defaultReplicaPlacement", "000", "default replication type if not specified")
@@ -118,7 +120,7 @@ func (fo *FilerOptions) startFiler() {
}
if *fo.publicPort != 0 {
- publicListeningAddress := *fo.ip + ":" + strconv.Itoa(*fo.publicPort)
+ publicListeningAddress := *fo.bindIp + ":" + strconv.Itoa(*fo.publicPort)
glog.V(0).Infoln("Start Seaweed filer server", util.VERSION, "public at", publicListeningAddress)
publicListener, e := util.NewListener(publicListeningAddress, 0)
if e != nil {
@@ -133,7 +135,7 @@ func (fo *FilerOptions) startFiler() {
glog.V(0).Infof("Start Seaweed Filer %s at %s:%d", util.VERSION, *fo.ip, *fo.port)
filerListener, e := util.NewListener(
- *fo.ip+":"+strconv.Itoa(*fo.port),
+ *fo.bindIp+":"+strconv.Itoa(*fo.port),
time.Duration(10)*time.Second,
)
if e != nil {