Install MongoDB 3.6 Community Edition
--Configuring the Yum source for MongoDB
- Vim/etc/yum.repos.d/mongodb-org-3.4.repo
--Add the following content:
[mongodb-org-3.6] name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/ mongodb-org/3.6/x86_64/Gpgcheck=1enabled=1gpgkey=https:// WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.6.ASC
--Installing MongoDB
sudo yum install-y mongodb-org
Start MongoDB
--Configure SELinux
Method One:
If SELinux turns on enforcing mode:
Method Two:
If SELinux is disabled (the system must be restarted in such a way as to modify the configuration file):
SELINUX=disabled
Or
SELINUX=permissive
--Start MongoDB
- Systemctl Start Mongod.service
--Configure fire protection to add the 27017 port number to the exception:
- Firewall-cmd--permanent --add-port=27017/tcp
- Firewall-cmd--reload
- Systemctl Restart Firewalld.service
--Set Boot start
- Systemctl Enable Mongod.service
--Start MONGO shell
- Mongo
--Set up MongoDB remote access:
Edit mongod.conf Comment Bindip and restart MongoDB.
- Vim/etc/mongod.conf
- Systemctl Restart Mongod.service
--Stop MongoDB
- Systemctl Stop Mongod.service
The installation of MongoDB