Ubuntu18.04安装mongo4.0
# 导入源
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y openssl libcurl3 mongodb-org
sudo apt-get install mongodb
启动方法
启动mongo
sudo systemctl start mongodb
sudo systemctl status mongodb
#开机启动mongo
sudo systemctl enable mongodb
sudo systemctl enable mongod.service