Debian MongoDB故障排查步骤如下:
sudo systemctl status mongod 确认服务是否运行。/var/log/mongodb/mongod.log,定位错误信息。/etc/mongod.conf 中 dbPath、logPath、port 等配置是否正确。/var/lib/mongodb)存在,且属主为 mongodb 用户。sudo netstat -tulnp | grep 27017 确认端口未被占用。top、df -h 监控 CPU、内存、磁盘空间是否充足。mongostat:监控实时性能(如操作次数、内存使用)。mongotop:查看集合级读写负载。db.serverStatus()/db.currentOp():获取服务器状态或当前操作详情。