centos 7 安装mongdb3.6

1 配置MongoDB的yum源

# 编辑文件
vim /etc/yum.repos.d/mongodb-org-3.6.repo 

# 添加以下内容
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc


2 安装mongodb

yum install -y mongodb-org


3 启动mongodb

# 启动
systemctl start mongod.service

# 停止
systemctl stop mongod.service

# 重启
systemctl restart mongod.service

# 开机启动
systemctl enable mongod.service



你可能感兴趣的:(centos 7 安装mongdb3.6)