Debian 上 MinIO 故障排查手册
一 快速定位流程
systemctl status minio、journalctl -u minio -n 50 --no-pagerfree -h、df -h、du -sh /your/minio/data、uptime、top -bn1 | head -20ps aux | grep minio、ss -tlnp | grep -E ':9000|:9001'cat /etc/default/minio、cat /etc/systemd/system/minio.serviceMINIO_VOLUMES、MINIO_ROOT_USER、MINIO_ROOT_PASSWORD、EnvironmentFile=/etc/default/minio,以及运行用户与数据目录权限一致curl -I http://127.0.0.1:9000、curl -I http://127.0.0.1:9001二 常见故障与修复
systemctl status 提示 Variable MINIO_VOLUMES not set in /etc/default/minio 或 status=217/USER/etc/default/minio 中设置:MINIO_VOLUMES=/data/minio、MINIO_ROOT_USER=admin、MINIO_ROOT_PASSWORD=StrongPass!、MINIO_OPTS="--console-address :9001"/etc/systemd/system/minio.service 中确保:EnvironmentFile=/etc/default/minio,User=minio/Group=minio 且该用户存在systemctl daemon-reload && systemctl restart miniojournalctl 出现 Out of memory / Killed process dd if=/dev/zero of=/swapfile bs=1M count=2048 && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfiledf -h 接近 100%ss -tlnp 看不到 :9000/:9001 或被其他进程占用--console-address :9002)firewall-cmd --permanent --add-port=9000/tcp --add-port=9001/tcp && firewall-cmd --reloadchown -R minio:minio /data/miniochmod -R 755 /data/minio/etc/minio/certs/,文件名为 private.key 与 public.crtMINIO_OPTS="--certs-dir /etc/minio/certs --console-address :9001"curl -vk https://localhost:9001三 日志与审计配置
StandardOutput=append:/var/log/minio/minio.log),并使用 logrotate 做按日轮转与压缩,避免日志过大影响磁盘与排查效率export MINIO_AUDIT_WEBHOOK_ENABLE=on、export MINIO_AUDIT_WEBHOOK_ENDPOINT=http://your-log-server/webhooklogger_webhook 发送到 Splunk/ELK 等平台,便于告警与可视化分析四 性能与稳定性检查
echo "minio-user soft nofile 65536" >> /etc/security/limits.conf、echo "minio-user hard nofile 65536" >> /etc/security/limits.confecho mq-deadline > /sys/block/sdX/queue/schedulerexport MINIO_API_REQUESTS_MAX=1600export MINIO_CACHE_DRIVES="/tmp/cache1,/tmp/cache2"、export MINIO_CACHE_EXCLUDE="*.pdf"mc admin info myminio五 应急与数据修复
fsck /dev/sdXminio server /data/minio --healmc mirror /local/path myminio/bucket-namemc mirror --limit-upload 100MB /local/path myminio/bucket-namemc mirror s3-source/bucket myminio/bucket-name