From 45a12505f2732b195cf4a7535297bb207ecfa925 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 25 May 2016 08:22:31 -0700 Subject: [PATCH] bind ip address when starting filer fix https://github.com/chrislusf/seaweedfs/issues/290 --- go/weed/filer.go | 4 +++- go/weed/server.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go/weed/filer.go b/go/weed/filer.go index ae9dac2ca..68bc3e407 100644 --- a/go/weed/filer.go +++ b/go/weed/filer.go @@ -17,6 +17,7 @@ var ( type FilerOptions struct { master *string + ip *string port *int collection *string defaultReplicaPlacement *string @@ -35,6 +36,7 @@ func init() { cmdFiler.Run = runFiler // break init cycle f.master = cmdFiler.Flag.String("master", "localhost:9333", "master server location") f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this collection") + f.ip = cmdFiler.Flag.String("ip", "", "filer server http listen ip address") f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port") f.dir = cmdFiler.Flag.String("dir", os.TempDir(), "directory to store meta data") f.defaultReplicaPlacement = cmdFiler.Flag.String("defaultReplicaPlacement", "000", "default replication type if not specified") @@ -78,7 +80,7 @@ func runFiler(cmd *Command, args []string) bool { } r := http.NewServeMux() - _, nfs_err := weed_server.NewFilerServer(r, *f.port, *f.master, *f.dir, *f.collection, + _, nfs_err := weed_server.NewFilerServer(r, *f.ip, *f.port, *f.master, *f.dir, *f.collection, *f.defaultReplicaPlacement, *f.redirectOnRead, *f.disableDirListing, *f.secretKey, *f.cassandra_server, *f.cassandra_keyspace, diff --git a/go/weed/server.go b/go/weed/server.go index 6b5fcf9e4..242e50861 100644 --- a/go/weed/server.go +++ b/go/weed/server.go @@ -165,7 +165,7 @@ func runServer(cmd *Command, args []string) bool { if *isStartingFiler { go func() { r := http.NewServeMux() - _, nfs_err := weed_server.NewFilerServer(r, *filerOptions.port, *filerOptions.master, *filerOptions.dir, *filerOptions.collection, + _, nfs_err := weed_server.NewFilerServer(r, *serverBindIp, *filerOptions.port, *filerOptions.master, *filerOptions.dir, *filerOptions.collection, *filerOptions.defaultReplicaPlacement, *filerOptions.redirectOnRead, *filerOptions.disableDirListing, *filerOptions.secretKey,