一、安装mongodb sudo apt install -y mongodb 二、基本操作 # 检查服务的状态 systemctl status mongodb # 停止服务 systemctl stop mongodb # 启动服务 systemctl start mongodb # 重启服务 systemctl restart mongodb # 禁止开机自启动 systemctl disable mongodb # 允许开机自启动 systemctl enable mongodb