CentOS 5.6 How do I install the MongoDB database?

Source: Internet
Author: User
Tags mongodb

1. Download Linux version of MongoDB database

Download the MongoDB Linux version to the official download page, 32-bit or 64-bit to choose from their 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 compressed package after the 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

Add MongoDB Startup items to rc.local guarantee MongoDB start when 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

See the output of the following figure shows that MongoDB started


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

/usr/local/mongodb/bin/mongo

To enter the MongoDB shell mode, if you see the following output, it means that MongoDB has started successfully, Have fun!

Supplementary content:

Method of installing MongoDB production environment through 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 content

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

Note that the MONGODB has 2GB data capacity limitations under the 32-bit system

Run the following command after saving

Yum Install Mongo-10gen-server

You can install the MongoDB.

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.