aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorvadimartynov <166398828+vadimartynov@users.noreply.github.com>2024-07-12 21:56:26 +0400
committerGitHub <noreply@github.com>2024-07-12 10:56:26 -0700
commitec9e7493b34df5c13462cdaeab5b35f152d0cb68 (patch)
tree035534cd1480185b7ffcd94a66b216df70988433 /weed/command/filer.go
parentcb5dae0c9cd0e19c7e865ebf1ddfdf5138e8a74c (diff)
downloadseaweedfs-ec9e7493b34df5c13462cdaeab5b35f152d0cb68.tar.xz
seaweedfs-ec9e7493b34df5c13462cdaeab5b35f152d0cb68.zip
-metricsIp cmd flag (#5773)
* Added/Updated: - Added metrics ip options for all servers; - Fixed a bug with the selection of the binIp or ip parameter for the metrics handler; * Fixed cmd flags
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 6478493b6..2554b3477 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -57,6 +57,7 @@ type FilerOptions struct {
disableHttp *bool
cipher *bool
metricsHttpPort *int
+ metricsHttpIp *string
saveToFilerLimit *int
defaultLevelDbDirectory *string
concurrentUploadLimitMB *int
@@ -90,6 +91,7 @@ func init() {
f.disableHttp = cmdFiler.Flag.Bool("disableHttp", false, "disable http request, only gRpc operations are allowed")
f.cipher = cmdFiler.Flag.Bool("encryptVolumeData", false, "encrypt data on volume servers")
f.metricsHttpPort = cmdFiler.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
+ f.metricsHttpIp = cmdFiler.Flag.String("metricsIp", "", "metrics listen ip. If empty, default to same as -ip.bind option.")
f.saveToFilerLimit = cmdFiler.Flag.Int("saveToFilerLimit", 0, "files smaller than this limit will be saved in filer store")
f.defaultLevelDbDirectory = cmdFiler.Flag.String("defaultStoreDir", ".", "if filer.toml is empty, use an embedded filer store in the directory")
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
@@ -178,7 +180,15 @@ func runFiler(cmd *Command, args []string) bool {
util.LoadConfiguration("security", false)
- go stats_collect.StartMetricsServer(*f.bindIp, *f.metricsHttpPort)
+ switch {
+ case *f.metricsHttpIp != "":
+ // noting to do, use f.metricsHttpIp
+ case *f.bindIp != "":
+ *f.metricsHttpIp = *f.bindIp
+ case *f.ip != "":
+ *f.metricsHttpIp = *f.ip
+ }
+ go stats_collect.StartMetricsServer(*f.metricsHttpIp, *f.metricsHttpPort)
filerAddress := pb.NewServerAddress(*f.ip, *f.port, *f.portGrpc).String()
startDelay := time.Duration(2)