Centos7下yum安装mongodb方法

2024-10-25 07:56:43

1、添加mongodb的yum源cat >> /etc/yum.repos.d/mongodb-3.桃轾庾殇4.repo << 'EOF'[mongodb-org-3.4]name=MongoDB 3.4 Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/gpgcheck=0enabled=1EOF这里可以修改 gpgcheck=0, 省去gpg验证

Centos7下yum安装mongodb方法

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

Centos7下yum安装mongodb方法

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

Centos7下yum安装mongodb方法

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

Centos7下yum安装mongodb方法

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

Centos7下yum安装mongodb方法

6、关闭selinuxsetenforce 0

Centos7下yum安装mongodb方法

7、关闭firewallsystemctl 衡痕贤伎stop firewalld.servicesystemctl disable firewalld.service

Centos7下yum安装mongodb方法

8、启动mongodsystemctl start mongod.service

Centos7下yum安装mongodb方法
猜你喜欢