Minio监控
小于 1 分钟
Minio监控
运行Minio Client(mc)容器
docker run -it --entrypoint=/bin/sh minio/mc
设置别名
mc alias set minio http://172.100.2.65:9000 minioadmin minioadmin
输出结果:
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.
Added `minio` successfully.
生成 Prometheus 抓取目标配置
mc admin prometheus generate minio
输出结果:
scrape_configs:
- job_name: minio-job
bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwcm9tZXRoZXVzIiwic3ViIjoibWluaW9hZG1pbiIsImV4cCI6NDg2NzAyNTgyOX0.QgEjjQvA1ieHhM8sxMxMhYGGOcmsN4dQT1lIcOHGe5Lo4ZTeTsgzKAq65HPBkFQ1RayMzolQ_R2J3aByVe_ZNw
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['172.100.2.65:9000']
我们可以看到是通过bearer_token
的方式获取指标,将上面生成的抓取目标配置同步到Prometheus
minio-dashboard
minio常用监控语句
minio集群节点离线
minio_cluster_nodes_offline_total > 0
minio集群磁盘离线
minio_cluster_drive_offline_total > 0