Installing MongoDB under Centos

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

Installing MongoDB under Centos

First, installation method

Method (i)

1 Configuration Package Management system

Create the /etc/yum.repos.d/mongodb.repo file, of course we use a 64-bit system, 32-bit situation is no longer considered. The contents of the file are:

[Mongodb]name=MongoDB repositorybaseurl=http://Downloads-distro.mongodb.org/repo /redhat/os/x86_64/gpgcheck=0enabled=1

2 Install MongoDB package and associated tools.

sudo yum install mongodb-org

Method (ii)

1 If you install the specified version of MongoDB, or install to the specified directory, you can manually download the MongoDB program, such as the latest version of the MongoDB program for MONGODB-LINUX-X86_64-2.6.4.TGZ.
I am here to download the installer files to this machine, and then upload to the server. The command is as follows

SCP Mongodb-linux-x86_64-2.6.4.tar [Email protected]:/home/tools

2 Decompression Program

Tar zxf mongodb-linux-x86_64-2.6.4.tar/home/mongodb/

3 MongoDB default database files are stored under/DATA/DB, if you use the default, you must create this folder in advance and have write permission, if you change the location of the database file, you can use the –dbpath option to specify the location, the command is as follows:

Mongod--dbpath/home/databases/sdkstat

Second, start

1 Start MongoDB

sudo service Mongod start

2 Stop MongoDB

sudo service Mongod stop

3 Restarting MongoDB

sudo service mongod restart

Official Installation Documentation: Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/

Installing MongoDB under Centos

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.