监控 Linux 上的 MinIO 可以从 系统层、MinIO 服务层、对象存储层、告警与可视化 四个层面来做。下面给你一套实战型监控方案,从简单到专业都有。
MinIO 内置了 Prometheus 指标和 Web 监控页面。
访问:
http://<minio-server>:9000
在 Dashboard 中可以看到:
✅ 优点:开箱即用
❌ 缺点:不能长期存储、不能告警
这是 最主流、最专业 的 MinIO 监控方案。
MinIO 默认暴露指标接口:
http://<minio-server>:9000/minio/v2/metrics/cluster
http://<minio-server>:9000/minio/v2/metrics/node
验证:
curl http://localhost:9000/minio/v2/metrics/cluster
prometheus.yml 示例:
scrape_configs:
- job_name: "minio"
static_configs:
- targets:
- "localhost:9000"
启动 Prometheus:
./prometheus --config.file=prometheus.yml
官方推荐仪表盘:
13502在 Grafana 中:
Dashboards → Import → 13502
可监控:
✅ 生产环境最常用
MinIO 是磁盘 + 网络密集型服务,系统指标非常重要。
./node_exporter
Prometheus 配置:
- job_name: "node"
static_configs:
- targets: ["localhost:9100"]
重点监控:
| 指标 | 说明 |
|---|---|
minio_disk_usage |
磁盘使用 |
minio_http_requests_total |
请求数 |
minio_http_request_duration_seconds |
请求延迟 |
minio_node_offline |
节点是否离线 |
minio_bucket_objects |
桶对象数量 |
journalctl -u minio -f
或容器:
docker logs -f minio
ERROR
Disk not found
Request timed out
示例告警规则:
- alert: MinIOHighDiskUsage
expr: minio_disk_usage > 0.8
for: 5m
labels:
severity: warning
annotations:
summary: "MinIO 磁盘使用过高"
#!/bin/bash
curl -s http://localhost:9000/minio/health/live
if [ $? -ne 0 ]; then
echo "MinIO is down"
fi
配合 crontab 使用。
| 场景 | 推荐方案 |
|---|---|
| 测试环境 | Web UI |
| 生产环境 | Prometheus + Grafana |
| 云原生 | Prometheus Operator |
| 简单检查 | curl + 脚本 |
如果你愿意,我可以:
你现在用的是 单机 MinIO 还是分布式?Docker 还是二进制?