Brief introduction
MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.
Packages Package Description
The MongoDB official source contains the following dependent packages:
MONGODB-ORG:MONGODB metadata package, install the following four packages automatically:
1.mongodb-org-server: Contains the MongoDB daemon and related configuration and initialization scripts.
2.mongodb-org-mongos: Contains the daemon for MONGOs.
3.mongodb-org-shell: Contains the MONGO shell.
4.mongodb-org-tools: Tools with MongoDB: Mongoimport, Bsondump, Mongodump, Mongoexport, Mongofiles, Mongooplog, Mongoperf, Mongorestore, Mongostat, and Mongotop.
Installation steps
1. Configure the Yum source for MongoDB
To create a Yum source file:
Vim/etc/yum.repos.d/mongodb-org-3.4.repo
Add the following content:
[mongodb-org-3.4]
Name=mongodb Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
Gpgcheck=1
Enabled=1
Gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
Here you can modify the gpgcheck=0, eliminating the GPG verification
Update all packages before installing: Yum update (optional operation)
2. Installing MongoDB
installation command:
Yum-y Install mongodb-org
After installation is complete
View MONGO installation location Whereis Mongod
View Modify Profile: vim/etc/mongod.conf
3. Start MongoDB
Start Mongodb:systemctl start Mongod.service
Stop Mongodb:systemctl Stop Mongod.service
Find the status of MongoDB: Systemctl status Mongod.service
4. External network access requires the firewall to be turned off:
CentOS 7.0 defaults to using firewall as the firewall, where the iptables firewall is changed.
Close firewall:
Systemctl Stop Firewalld.service #停止firewall
Systemctl Disable Firewalld.service #禁止firewall开机启动
5. Set boot up
Systemctl Enable Mongod.service
6. Start the MONGO Shell
Command: MONGO
View database: Show DBS
7. Set up MongoDB remote access:
Edit mongod.conf Comment Bindip and restart MongoDB.
Vim/etc/mongod.conf
Restart Mongodb:systemctl Restart Mongod.service
CENTOS7 installation MongoDB3.4