二进制安装
[root@mysql5-7 mongodb-6.0.4]
cd /opt/mongodb-6.0.4
mongod --dbpath /data/mongodb --logpath ./mongod.log --bind_ip=0.0.0.0 --fork
[root@mysql5-7 mongodb-6.0.4]
cd /opt/mongodb-6.0.4
mongod --dbpath /data/mongodb --logpath ./mongod.log --shutdown
YUM 安装
cat > /etc/yum.repos.d/mongodb-org-4.4.repo << EOF
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-4.4.asc
EOF
yum install -y mongodb-org
systemctl start mongod