First, installation
1. Configuring the Yum Management Pack
1), create the file under Path/etc/yum.repos.d/Mongodb-org-3.4.repo
cd/etc/yum.repos.d/
Touch Mongodb-org-3.4.repo
2), write the following in the file Mongodb-org-3.4.repo
[mongodb-org-3.4]
Name=mongodb Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enable=1
GPGKEY=HTTPS://WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.4.ASC
2, install MongoDB (will install mongodb-org package and its dependent package mongodb-org-server, Mongodb-org-mongos, Mongodb-org-shell, Mongodb-org-tools)
The DB instance defaults to the/var/lib/mongo path, the log defaults to the/var/log/mongodb path, or you can modify the/etc/ Storage.dbpath and Systemlog.path configuration of mongod.conf files
Yum install-y mongodb-org
3. Open MongoDB Service
Service Mongod Start
4, check the log mode, verify that the service opened successfully, which has a behavior: [Thread1] waiting for connections on port 27017
Cat/var/log/mongodb/mongod.log
5. Set Boot start
chkconfig Mongod on
6. Stop MongoDB Service
Service Mongod Stop
7. Restart MongoDB Service
Service Mongod Restart
Second, uninstall
1. Stop the Service
Service Mongod Stop
2. Remove Installed Packages
Yum Erase $ (rpm-qa | grep mongodb-org)
3. Delete data and logs
Rm-r/var/log/mongodb
Rm-r/var/lib/mongo
CentOS7 on MongoDB Install, uninstall