|
|
@ -29,7 +29,7 @@ func init() { |
|
|
|
} |
|
|
|
|
|
|
|
var cmdServer = &Command{ |
|
|
|
UsageLine: "server -port=8080 -dir=/tmp -max=5 -ip=server_name", |
|
|
|
UsageLine: "server -port=8080 -dir=/tmp -volume.max=5 -ip=server_name", |
|
|
|
Short: "start a server, including volume server, and automatically elect a master server", |
|
|
|
Long: `start both a volume server to provide storage spaces |
|
|
|
and a master server to provide volume=>location mapping service and sequence number of file ids |
|
|
@ -54,6 +54,7 @@ var ( |
|
|
|
serverRack = cmdServer.Flag.String("rack", "", "current volume server's rack name") |
|
|
|
serverWhiteListOption = cmdServer.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.") |
|
|
|
serverPeers = cmdServer.Flag.String("master.peers", "", "other master nodes in comma separated ip:masterPort list") |
|
|
|
serverGarbageThreshold = cmdServer.Flag.String("garbageThreshold", "0.3", "threshold to vacuum and reclaim spaces") |
|
|
|
masterPort = cmdServer.Flag.Int("master.port", 9333, "master server http listen port") |
|
|
|
masterMetaFolder = cmdServer.Flag.String("master.dir", "", "data directory to store meta data, default to same as -dir specified") |
|
|
|
masterVolumeSizeLimitMB = cmdServer.Flag.Uint("master.volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.") |
|
|
@ -174,7 +175,7 @@ func runServer(cmd *Command, args []string) bool { |
|
|
|
go func() { |
|
|
|
r := mux.NewRouter() |
|
|
|
ms := weed_server.NewMasterServer(r, *masterPort, *masterMetaFolder, |
|
|
|
*masterVolumeSizeLimitMB, *volumePulse, *masterConfFile, *masterDefaultReplicaPlacement, *garbageThreshold, serverWhiteList, |
|
|
|
*masterVolumeSizeLimitMB, *volumePulse, *masterConfFile, *masterDefaultReplicaPlacement, *serverGarbageThreshold, serverWhiteList, |
|
|
|
) |
|
|
|
|
|
|
|
glog.V(0).Infoln("Start Weed Master", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*masterPort)) |
|
|
|