Installing MongoDB shorthand on CentOS

Source: Internet
Author: User

Test Environment Version CentOS 6.5

First create the installation destination folder and go to the folder:

mkdir /opt//opt/mongodb

Create users and user groups for MongoDB:

-G MongoDB MongoDB

Download the required source files for installation:

This download is slow, I am collecting MongoDB 2.6.1 version

Can be downloaded from here: http://pan.baidu.com/s/1nfAA6

or download from mongodb.org (very slow)

Http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz

Unpack

Tar mongodb-linux-x86_64-2.6.1.tgz

To create a MongoDB data store folder:

mkdir -p/data/dbchown mongodb/data/db

Set Environment variables:

VI ~/

Append content: Export PATH=.: $PATH:/opt/mongodb/mongodb-linux-x86_64-2.6.1/bin

Make the setting effective immediately:

Now that the installation is complete, start MongoDB:

Mongod--dbpath/data/db &

To stop MongoDB:

Killall Mongod

Add MongoDB to the startup item:

Echo " mongod--dbpath/data/db & " >>/etc/rc.local

To perform a link:

Mongo

Displays the following information to indicate that the installation was successful:

MongoDB Shell version:2.6.1
Connecting To:test

The specific use of MongoDB can be referred to W3cschool's tutorial: http://www.w3cschool.cc/mongodb/mongodb-tutorial.html

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.