Debian 10/9 安装MongoDB 4.2

最新的MongoDB4.2仅仅支持x64的Debian

MongoDB 4.2 Community Edition supports the following 64-bit Debian releases on x86_64 architecture:

Debian 10 “Buster” (Starting in MongoDB Community 4.2.1)

Debian 9 “Stretch”

MongoDB only supports the 64-bit versions of these platforms.

使用apt安装:

1.导入Mongodb GPG Key

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

2.添加源

Debian 10
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

Debian 9
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

3.更新APT源

sudo apt-get update

4.安装MongoDB全套

sudo apt-get install -y mongodb-org

启动MongoBD

启动
sudo systemctl start mongod
查看运行状态
sudo systemctl status mongod
设置开机自启
sudo systemctl enable mongod

留下评论