监控 MinIO 在 CentOS 上的状态
一 基础运行状态检查
sudo systemctl status miniosudo journalctl -u minio -fsudo systemctl is-enabled miniops -ef | grep minioss -ltnp | grep -E ':(9000|9001)'mc alias set myminio http://<MINIO_SERVER_IP>:9000 <ACCESS_KEY> <SECRET_KEY>mc admin info myminiomc ls myminiomc admin ping myminio(返回 pong 表示可达)docker ps、docker logs 或 podman 等效命令。二 指标监控与可视化
mc admin prometheus generate myminio,将输出的 scrape_configs 片段加入 Prometheus。scrape_configs:
- job_name: minio-job
bearer_token: <TOKEN>
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['<MINIO_SERVER_IP>:9000']
- job_name: minio-job-node
bearer_token: <TOKEN>
metrics_path: /minio/v2/metrics/nodes
scheme: http
static_configs:
- targets: ['<MINIO_SERVER_IP>:9000']
- job_name: minio-job-bucket
bearer_token: <TOKEN>
metrics_path: /minio/v2/metrics/buckets
scheme: http
static_configs:
- targets: ['<MINIO_SERVER_IP>:9000']
三 主机与磁盘 I O 监控
sudo yum install -y sysstatiostat -x 1sudo yum install -y iotop && sudo iotoptop、htopsar -n DEV 1df -h、lsblk
这些工具可帮助定位 磁盘瓶颈、I O 饱和 与 容量告警 等常见性能问题。四 关键告警规则示例
up{job="minio-job"} == 0sum(rate(http_requests_total{job="minio-job",status=~"5.."}[5m])) / sum(rate(http_requests_total{job="minio-job"}[5m])) > 0.01(1 - (sum(node_filesystem_avail_bytes{mountpoint="/data"}) / sum(node_filesystem_size_bytes{mountpoint="/data"}))) * 100 > 80histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{job="minio-job"}[5m])) by (le)) > 1sum(rate(replication_failed_total{job="minio-job-bucket"}[15m])) > 0
将规则保存为 Prometheus 规则文件并热加载,配合 Alertmanager 实现 邮件/企业微信/钉钉 等通知。五 快速排障清单
curl -I http://<IP>:9000/minio/health/livehttp://<IP>:9001(若启用了 Console)sudo systemctl restart minio 或通过 mc admin service restart myminio 滚动重启。journalctl -u minio -f