1. MongoDB Installation and startup

Source: Internet
Author: User
Tags install mongodb yum install mongodb

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.