添加repo
vim /etc/yum.repos.d/mongodb.repo
[mongodb-org]
name=MongoDB Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mongodb/yum/el$releasever/
gpgcheck=0
enabled=1
安装启动
yum makecache
yum install mongodb-org
chkconfig mongod on
service mongod start