1. MongoDB is a document Database.
A record in MongoDB is a DOCUMENT,MONGODB documents be similar to JSON objects.
A document can contain other documents and can contain arrays and arrays of documents.
2. MongoDB has many versions, such as Linux\windows. Take Linux for example.
MongoDB is made up of 5 parts, namely:
mongodb-org
Mongodb-org-server
Mongodb-org-shell
Mongodb-org-mongos
Mongodb-org-tools
3. Installation
Install with yum, install previously required to create a/etc/yum.repos.d/mongodb.repo to specify MongoDB Repository, 64-bit address
[Mongodb]name=MongoDB repositorybaseurl=http://Downloads-distro.mongodb.org/repo /redhat/os/x86_64/gpgcheck=0Enabled=1
If it is 32 bits, use the
[Mongodb]name=MongoDB repositorybaseurl=http://Downloads-distro.mongodb.org/repo /redhat/os/i686/gpgcheck=0Enabled=1
Execute the following Setup command:
sudo yum install mongodb-org
This will install the latest version, and you can also specify the version of the installation, for example, install version 2.6.1:
sudo yum install mongodb-org-2.6. 1 mongodb-org-server-2.6. 1 mongodb-org-shell-2.6. 1 mongodb-org-mongos-2.6. 1 mongodb-org-tools-2.6. 1
When the installation is complete, yum will automatically update MongoDB to the latest version, and if you want it to not be automatically updated, you will need to add it to the/etc/yum.conf file:
Exclude=MongoDB-org,mongodb-org-server,mongodb-org-shell , MongoDB-org-mongos,mongodb-org-Tools
4. Start
After installation of the MongoDB installation directory in/var/lib/mongo, related logs are recorded in the/var/log/mongo file
sudo service Mongod start
After executing the above command, you can view the relevant boot information by/var/log/mongodb/mongod.log the log file.
You can also use the command to see if the system startup entry is being joined:
sudo chkconfig mongod on
5. Stop
sudo service mongod restart