Ubuntu20.04
sudo apt-get install gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt install mongodb-org
sudo systemctl start mongod.service sudo systemctl enable mongod
sudo systemctl status mongod
mongo --eval 'db.runCommand({ connectionStatus: 1 })'
vim /etc/mongod.conf
重启
sudo systemctl restart mongod
查看状态
sudo systemctl status mongod
停止
sudo systemctl stop mongod
关闭开机启动
sudo systemctl disable mongod
mongo