diff options
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/master.go | 15 | ||||
| -rw-r--r-- | weed/command/server.go | 17 | ||||
| -rw-r--r-- | weed/command/volume.go | 6 |
3 files changed, 16 insertions, 22 deletions
diff --git a/weed/command/master.go b/weed/command/master.go index bda8493ed..d7c0356d3 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -45,12 +45,14 @@ var ( mpulse = cmdMaster.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats") defaultReplicaPlacement = cmdMaster.Flag.String("defaultReplication", "000", "Default replication type if not specified.") // mTimeout = cmdMaster.Flag.Int("idleTimeout", 30, "connection idle seconds") - mMaxCpu = cmdMaster.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs") - garbageThreshold = cmdMaster.Flag.Float64("garbageThreshold", 0.3, "threshold to vacuum and reclaim spaces") - masterWhiteListOption = cmdMaster.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.") - disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.") - masterCpuProfile = cmdMaster.Flag.String("cpuprofile", "", "cpu profile output file") - masterMemProfile = cmdMaster.Flag.String("memprofile", "", "memory profile output file") + mMaxCpu = cmdMaster.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs") + garbageThreshold = cmdMaster.Flag.Float64("garbageThreshold", 0.3, "threshold to vacuum and reclaim spaces") + masterWhiteListOption = cmdMaster.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.") + disableHttp = cmdMaster.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.") + masterCpuProfile = cmdMaster.Flag.String("cpuprofile", "", "cpu profile output file") + masterMemProfile = cmdMaster.Flag.String("memprofile", "", "memory profile output file") + masterMetricsAddress = cmdMaster.Flag.String("metrics.address", "", "Prometheus gateway address") + masterMetricsIntervalSec = cmdMaster.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") masterWhiteList []string ) @@ -82,6 +84,7 @@ func runMaster(cmd *Command, args []string) bool { *mpulse, *defaultReplicaPlacement, *garbageThreshold, masterWhiteList, *disableHttp, + *masterMetricsAddress, *masterMetricsIntervalSec, ) listeningAddress := *masterBindIp + ":" + strconv.Itoa(*mport) 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) diff --git a/weed/command/volume.go b/weed/command/volume.go index 5726528d5..c775ac5cf 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -45,8 +45,6 @@ type VolumeServerOptions struct { cpuProfile *string memProfile *string compactionMBPerSecond *int - metricsAddress *string - metricsIntervalSec *int } func init() { @@ -68,8 +66,6 @@ func init() { v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file") v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file") v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second") - v.metricsAddress = cmdVolume.Flag.String("metrics.address", "", "Prometheus gateway address") - v.metricsIntervalSec = cmdVolume.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") } var cmdVolume = &Command{ @@ -165,8 +161,6 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v v.whiteList, *v.fixJpgOrientation, *v.readRedirect, *v.compactionMBPerSecond, - *v.metricsAddress, - *v.metricsIntervalSec, ) listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port) |
