aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-06-01 00:39:39 -0700
committerChris Lu <chris.lu@gmail.com>2018-06-01 00:39:39 -0700
commit43e3f5724ca31918cd5a3d282639bd4f34e6bc58 (patch)
tree8aa653c78756a9adc2f98e7e281e0892bad95735 /weed/command/filer.go
parenta6f7f9b0b8baedad7b1555c7e01a4ab3cec3784c (diff)
downloadseaweedfs-43e3f5724ca31918cd5a3d282639bd4f34e6bc58.tar.xz
seaweedfs-43e3f5724ca31918cd5a3d282639bd4f34e6bc58.zip
use fixed list of masters in both filer and volume servers
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index fd9419772..1bd1493bd 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -13,6 +13,7 @@ import (
"github.com/soheilhy/cmux"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
+ "strings"
)
var (
@@ -20,7 +21,7 @@ var (
)
type FilerOptions struct {
- master *string
+ masters *string
ip *string
port *int
publicPort *int
@@ -34,7 +35,7 @@ type FilerOptions struct {
func init() {
cmdFiler.Run = runFiler // break init cycle
- f.master = cmdFiler.Flag.String("master", "localhost:9333", "master server location")
+ 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", "", "filer server http listen ip address")
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
@@ -47,8 +48,8 @@ func init() {
}
var cmdFiler = &Command{
- UsageLine: "filer -port=8888 -master=<ip:port>",
- Short: "start a file server that points to a master server",
+ UsageLine: "filer -port=8888 -master=<ip:port>[,<ip:port>]*",
+ Short: "start a file server that points to a master server, or a list of master servers",
Long: `start a file server which accepts REST operation for any files.
//create or overwrite the file, the directories /path/to will be automatically created
@@ -83,8 +84,10 @@ func (fo *FilerOptions) start() {
publicVolumeMux = http.NewServeMux()
}
+ masters := *f.masters
+
fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux,
- *fo.ip, *fo.port, *fo.master, *fo.collection,
+ *fo.ip, *fo.port, strings.Split(masters, ","), *fo.collection,
*fo.defaultReplicaPlacement, *fo.redirectOnRead, *fo.disableDirListing,
*fo.maxMB,
*fo.secretKey,