Prometheus监控minio

(29) 2023-12-07 21:12

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说Prometheus监控minio,希望能够帮助你!!!。

Prometheus监控minio

Prometheus监控minio_https://bianchenghao6.com/blog__第1张

环境准备:minio搭建好,prometheus搭建好

步骤:MinIO支持Prometheus jwt或两种身份验证模式public,默认情况下,MinIO以jwtmode 运行。要允许对普罗米修斯度量标准不进行身份验证就可以进行公共访问,请按如下所示设置环境。

对于不需要进行身份验证的Prometheus,在minio中操作

export MINIO_PROMETHEUS_AUTH_TYPE="public"

minio server ~/test

在rancher添加环境变量MINIO_PROMETHEUS_AUTH_TYPE="public"即可

对于需要进行身份验证的Prometheus配置

使用mc生成bearer_token,命令为mc admin prometheus generate <alias>。

修改prometheus.yml文件如下所示

scrape_configs:

- job_name: minio-job

bearer_token: <secret>

metrics_path: /minio/prometheus/metrics

scheme: http

static_configs:

- targets: ['localhost:9000']

实例如下:

部署minio时,采用不进行身份验证方式,在rancher添加环境变量MINIO_PROMETHEUS_AUTH_TYPE="public"即可

对于prometheus自动发现的,在minio的services中添加如下所示

Prometheus监控minio_https://bianchenghao6.com/blog__第2张

最后产生的效果如下:

Prometheus监控minio_https://bianchenghao6.com/blog__第3张

Prometheus监控minio_https://bianchenghao6.com/blog__第4张

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

上一篇

已是最后文章

下一篇

已是最新文章

发表回复