Minio监控
2024/4/18小于 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 > 0minio集群磁盘离线
minio_cluster_drive_offline_total > 0