diff options
Diffstat (limited to 'weed/command/server.go')
| -rw-r--r-- | weed/command/server.go | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/weed/command/server.go b/weed/command/server.go index ad6916b8f..0c5070981 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -87,6 +87,7 @@ func init() { filerOptions.master = cmdServer.Flag.String("filer.master", "", "default to current master server") filerOptions.collection = cmdServer.Flag.String("filer.collection", "", "all data will be stored in this collection") filerOptions.port = cmdServer.Flag.Int("filer.port", 8888, "filer server http listen port") + filerOptions.publicPort = cmdServer.Flag.Int("filer.port.public", 0, "filer server public http listen port") filerOptions.dir = cmdServer.Flag.String("filer.dir", "", "directory to store meta data, default to a 'filer' sub directory of what -dir is specified") filerOptions.defaultReplicaPlacement = cmdServer.Flag.String("filer.defaultReplicaPlacement", "", "Default replication type if not specified during runtime.") filerOptions.redirectOnRead = cmdServer.Flag.Bool("filer.redirectOnRead", false, "whether proxy or redirect to volume server during file GET request") @@ -116,6 +117,7 @@ func runServer(cmd *Command, args []string) bool { } *filerOptions.master = *serverIp + ":" + strconv.Itoa(*masterPort) + filerOptions.ip = serverIp if *filerOptions.defaultReplicaPlacement == "" { *filerOptions.defaultReplicaPlacement = *masterDefaultReplicaPlacement @@ -172,30 +174,9 @@ func runServer(cmd *Command, args []string) bool { if *isStartingFiler { go func() { time.Sleep(1 * time.Second) - r := http.NewServeMux() - _, nfs_err := weed_server.NewFilerServer(r, *serverBindIp, *filerOptions.port, *filerOptions.master, *filerOptions.dir, *filerOptions.collection, - *filerOptions.defaultReplicaPlacement, - *filerOptions.redirectOnRead, *filerOptions.disableDirListing, - *filerOptions.confFile, - *filerOptions.maxMB, - *filerOptions.secretKey, - *filerOptions.cassandra_server, *filerOptions.cassandra_keyspace, - *filerOptions.redis_server, *filerOptions.redis_password, *filerOptions.redis_database, - ) - if nfs_err != nil { - glog.Fatalf("Filer startup error: %v", nfs_err) - } - glog.V(0).Infoln("Start Seaweed Filer", util.VERSION, "at port", strconv.Itoa(*filerOptions.port)) - filerListener, e := util.NewListener( - ":"+strconv.Itoa(*filerOptions.port), - time.Duration(10)*time.Second, - ) - if e != nil { - glog.Fatalf("Filer listener error: %v", e) - } - if e := http.Serve(filerListener, r); e != nil { - glog.Fatalf("Filer Fail to serve: %v", e) - } + + filerOptions.start() + }() } |
