diff options
Diffstat (limited to 'weed/command/server.go')
| -rw-r--r-- | weed/command/server.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/weed/command/server.go b/weed/command/server.go index f6c2b5036..3799bedeb 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -24,10 +24,8 @@ import ( ) type ServerOptions struct { - cpuprofile *string - metricsAddress *string - metricsIntervalSec *int - v VolumeServerOptions + cpuprofile *string + v VolumeServerOptions } var ( @@ -67,6 +65,8 @@ var ( serverDisableHttp = cmdServer.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.") serverPeers = cmdServer.Flag.String("master.peers", "", "all master nodes in comma separated ip:masterPort list") serverGarbageThreshold = cmdServer.Flag.Float64("garbageThreshold", 0.3, "threshold to vacuum and reclaim spaces") + serverMetricsAddress = cmdServer.Flag.String("metrics.address", "", "Prometheus gateway address") + serverMetricsIntervalSec = cmdServer.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") 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.") @@ -83,8 +83,6 @@ var ( func init() { serverOptions.cpuprofile = cmdServer.Flag.String("cpuprofile", "", "cpu profile output file") - serverOptions.metricsAddress = cmdServer.Flag.String("metrics.address", "", "Prometheus gateway address") - serverOptions.metricsIntervalSec = cmdServer.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") 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") @@ -147,10 +145,8 @@ func runServer(cmd *Command, args []string) bool { filerOptions.dataCenter = serverDataCenter filerOptions.disableHttp = serverDisableHttp - filerOptions.metricsAddress = serverOptions.metricsAddress - filerOptions.metricsIntervalSec = serverOptions.metricsIntervalSec - serverOptions.v.metricsAddress = serverOptions.metricsAddress - serverOptions.v.metricsIntervalSec = serverOptions.metricsIntervalSec + filerOptions.metricsAddress = serverMetricsAddress + filerOptions.metricsIntervalSec = serverMetricsIntervalSec filerAddress := fmt.Sprintf("%s:%d", *serverIp, *filerOptions.port) s3Options.filer = &filerAddress @@ -210,6 +206,7 @@ func runServer(cmd *Command, args []string) bool { *masterVolumeSizeLimitMB, *masterVolumePreallocate, *pulseSeconds, *masterDefaultReplicaPlacement, *serverGarbageThreshold, serverWhiteList, *serverDisableHttp, + *serverMetricsAddress, *serverMetricsIntervalSec, ) glog.V(0).Infof("Start Seaweed Master %s at %s:%d", util.VERSION, *serverIp, *masterPort) |
