How does CentOS 5.6 Install the MongoDB database?

Source: Internet
Author: User
Tags install mongodb

1. Download the Linux version of the MongoDB database

Download MongoDB Linux version to the official download page, 32-bit or 64-bit choose according to your own situation

Http://www.mongodb.org/downloads

or download directly from the server using wget

wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz

Unzip the package after download is complete

Tar zxf mongodb-linux-i686-1.8.2.tgz

2. Installation Preparation

Move MongoDB to the/usr/local/mongdb folder

MV Mongodb-linux-i686-1.8.2/usr/local/mongodb

Create a database folder

Mkdir/usr/local/mongodb/data

Adding a MongoDB boot project to rc.local ensures that MongoDB starts when the server is powered on

echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data" >>/etc/rc.local

Start MongoDB

/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data

The output you see shows that MongoDB is up.

Of course, if you are not sure, you can run the following command

/usr/local/mongodb/bin/mongo

To enter MongoDB Shell mode, if you see the following output, then the MongoDB has started successfully, and has fun!

Supplemental content:

How to install MongoDB production environment with Yum

Create and edit

/etc/yum.repos.d/10gen.repo

64-bit System please fill in the following content

[10gen]
Name=10gen Repository
Baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64

Gpgcheck=0

32-bit system please fill in the following contents

[10gen]
Name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
Gpgcheck=0

Note MongoDB has a limit of 2GB data capacity under 32-bit systems

Run the following command after saving

Yum Install Mongo-10gen-server

You can install MongoDB.

How does CentOS 5.6 Install the MongoDB database?

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.