Manon.icu

I'm here to make you a better developer by teaching you everything I know about building for the web.

Published 2020-10-19

安装mongodb

安装 mongodb

oiuu4n

添加 mongodb 源

sudo vi /etc/yum.repos.d/mongodb-org.repo


[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
yum repolist

安装 mongodb

sudo yum install mongodb-org

启动
sudo systemctl start mongod

重载
sudo systemctl reload mongod

停止
sudo systemctl stop mongod

重启
sudo systemctl restart mongod

加入自启
sudo systemctl enable mongod

检查状态
systemctl status mongod