Centos7下yum安装mongodb方法
1、添加mongodb的yum源
cat >> /etc/yum.repos.d/mongodb-3.4.repo << 'EOF'
[mongodb-org-3.4]
name=MongoDB 3.4 Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=0
enabled=1
EOF
这里可以修改 gpgcheck=0, 省去gpg验证

2、会在/etc/yum.repos.d/中生成mongodb-3.4.repo文件

3、清空当前yum缓存和生成新的缓存
yum clean all
yum makecache
生成新的缓存可能等待的时间有点长

4、使用yum install mongodb-org命令进行安装

5、输入y并回车继续安装

6、关闭selinux
setenforce 0

7、关闭firewall
systemctl stop firewalld.service
systemctl disable firewalld.service

8、启动mongod
systemctl start mongod.service

阅读量:75
阅读量:127
阅读量:90
阅读量:190
阅读量:56