diff options
| author | vadimartynov <166398828+vadimartynov@users.noreply.github.com> | 2024-07-12 21:56:26 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-12 10:56:26 -0700 |
| commit | ec9e7493b34df5c13462cdaeab5b35f152d0cb68 (patch) | |
| tree | 035534cd1480185b7ffcd94a66b216df70988433 /weed/command/s3.go | |
| parent | cb5dae0c9cd0e19c7e865ebf1ddfdf5138e8a74c (diff) | |
| download | seaweedfs-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/s3.go')
| -rw-r--r-- | weed/command/s3.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/command/s3.go b/weed/command/s3.go index b7bb2a546..f71f2dc93 100644 --- a/weed/command/s3.go +++ b/weed/command/s3.go @@ -49,6 +49,7 @@ type S3Options struct { tlsCACertificate *string tlsVerifyClientCert *bool metricsHttpPort *int + metricsHttpIp *string allowEmptyFolder *bool allowDeleteBucketNotEmpty *bool auditLogConfig *string @@ -75,6 +76,7 @@ func init() { s3StandaloneOptions.tlsCACertificate = cmdS3.Flag.String("cacert.file", "", "path to the TLS CA certificate file") s3StandaloneOptions.tlsVerifyClientCert = cmdS3.Flag.Bool("tlsVerifyClientCert", false, "whether to verify the client's certificate") s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port") + s3StandaloneOptions.metricsHttpIp = cmdS3.Flag.String("metricsIp", "", "metrics listen ip. If empty, default to same as -ip.bind option.") s3StandaloneOptions.allowEmptyFolder = cmdS3.Flag.Bool("allowEmptyFolder", true, "allow empty folders") s3StandaloneOptions.allowDeleteBucketNotEmpty = cmdS3.Flag.Bool("allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket") s3StandaloneOptions.localFilerSocket = cmdS3.Flag.String("localFilerSocket", "", "local filer socket path") @@ -165,7 +167,13 @@ func runS3(cmd *Command, args []string) bool { util.LoadConfiguration("security", false) - go stats_collect.StartMetricsServer(*s3StandaloneOptions.bindIp, *s3StandaloneOptions.metricsHttpPort) + switch { + case *s3StandaloneOptions.metricsHttpIp != "": + // noting to do, use s3StandaloneOptions.metricsHttpIp + case *s3StandaloneOptions.bindIp != "": + *s3StandaloneOptions.metricsHttpIp = *s3StandaloneOptions.bindIp + } + go stats_collect.StartMetricsServer(*s3StandaloneOptions.metricsHttpIp, *s3StandaloneOptions.metricsHttpPort) return s3StandaloneOptions.startS3Server() |
