当前位置:网站首页>prometheus监控minio
prometheus监控minio
2022-07-30 05:49:00 【大新新大浩浩】
项目使用了minio,所以记录一下打开prometheus-minio监控的方式。
环境列表
- minio版本:minio version RELEASE.2021-11-09T03-21-45Z
- minio API端口:9000
- prometheus版本:2.37.0
- granafa版本:9.0.4
- min-dashboard-ID:13502
minio打开监控的两种方式
1、public方式
minio增加MINIO_PROMETHEUS_AUTH_TYPE=“public” 配置,然后重启minio服务
prometheus中的配置
- job_name: minio-job
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['192.168.xxx.xx:9000']
2、身份验证方式
首先使用minio client 设置别名,然后获取prometheus配置
我这里使用的是docker形式运行mc
#运行mc容器
docker pull minio/mc
docker run -it --entrypoint=/bin/sh minio/mc
#设置别名
mc alias set minio http://192.168.xxx.xxx:9000 admin admin
#输出
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
#生成配置
mc admin prometheus generate minio
#配置输出
scrape_configs:
- job_name: minio-job
bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ4MTI0MDA0NTcsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJhZG1pbiJ9.o2ymp655JwB05XlsXTtZJzDlpYUfT2ITgxOdYyqxiOfnkMznphUALSU0yhgobAaQCLtwAZgnKbjBfwxQJlzKSA
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['192.168.xxx.xxx:9000']
将生成的配置加入到prometheus的配置中,重启服务即可。
prometheus中的配置
- job_name: minio-job
bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ4MTI0MDA0NTcsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJhZG1pbiJ9.o2ymp655JwB05XlsXTtZJzDlpYUfT2ITgxOdYyqxiOfnkMznphUALSU0yhgobAaQCLtwAZgnKbjBfwxQJlzKSA
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['192.168.xxx.xx:9000']
区别
两种方式的区别就是token的使用。
我目前进行测试集群中使用public方式,target会提示“server returned HTTP status 403 Forbidden”,修改为身份验证方式后才可以正常获取到监控数据。区别如下两图

关于metrics_path问题
有些版本的metrics_path为/minio/prometheus/metrics
有些版本的metrics_path为/minio/v2/metrics/cluster
经过实际测试,至少我现在使用minio版本两个metrics_path都可以使用

granafa-dashboard数据展示


边栏推荐
猜你喜欢
随机推荐
wsl2设置静态ip(固定ip)static ip
独立按键控制led
牛客:删除公共字符
掌握JESD204B(一)–AD6676的调试
Selenium02
Mastering JESD204B (2) – Debugging of AD6676
单向链表的操作(带头结点)
Desthiobiotin-PEG4-Acid|脱硫生物素-PEG4-酸| 供应商和制造商
GAIA-IR:GraphScope 上的并行化图查询引擎
远程连接服务器的MySql
I can't hide it, I want to expose the bad things about cloud native
Ingress:从静态图分析到动态图分析
2021-05-26
Biotin-PEG4-DADPS-Picolyl-azide(CAS:2599839-59-3)生物素试剂
How to save modelsim simulation data as a file
C#最优二叉树----哈夫曼树
Graph analysis like NetworkX with GraphScope
读取GZ包的内容代码
IO进程线程->文件IO->day2
Alamofire source code analysis - POST request









