Background: Before once tried to install MongoDB, but online said the method of a variety, coupled with the virtual machine has a problem, so the installation is not successful, today in the group of questions, after a buddy's reminder, told me directly to the last Officer network, in accordance with the official online installation method, did not expect to really succeed.
Linux version is CentOS6.5, referring to the installation of the official website address is: https://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/, The corresponding also has a Chinese community http://docs.mongoing.com/manual-zh/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux.html , but the installation version in the Chinese community is now only updated to 2.6, the official website has been updated to 3.0, I installed the 3.0 version of the
In fact, it is very simple, two steps of installation:
1. Create file/etc/yum.repos.d/mongodb.repo to save the following MongoDB repositories configuration information
# Vi/etc/yum.repos.d/mongodb-org-3.0.repo
In the file, enter:
[mongodb-org-3.0]
Name=mongodb Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
Gpgcheck=0
Enabled=1
Save exit, if you need to install another version of the, please the parameters website tips
2. Install MongoDB software package and related tools.
# sudo yum install-y mongodb-org
This interface appears to indicate that the installation is complete
Start
Start with sudo service mongod start
Stop by sudo service Mongod stop
Restart with sudo service mongod restart
Installing MongoDB in Linux (2015-11-03-00:51:24)