Build MongoDB service based on CentOS 6.5 operating system

Source: Internet
Author: User

based on CentOS6.5 Operating System Setup MongoDB Service

MongoDB,is currently inITA non-relational database that is very popular in the industry(NOSQL),The flexible way to store data,Highly currentITPractitioners of the favor.MongoDBVery good realization of object-oriented thinking(OOThought),InMongoDBInEach record is aDocumentObject.MongoDBThe biggest advantage is that all data persistence operations are not manually written by developersSQLStatement,The direct call method can be easily implementedCRUDOperation.

This article uses the Linux system to build MongoDB Service, the following is the concrete construction process:

First, prepare the MongoDB installation package

Can download MongoDB package to http://www.mongodb.org/downloads


Second, prepare MongoDB users

[Email protected]~]# useradd-s/sbin/nologin MongoDB


Third, unpack and rename the extracted directory to MongoDB

[Email protected]~]# tar-zxf mongodb-linux-x86_64-2.6.4.tgz-c/usr/src/

[Email protected]~]# mv/usr/src/mongodb-linux-x86_64-2.6.4//usr/local/mongodb/


Iv. Enter the extracted directory

Because the mongodb directory does not contain its data store directory and the log directory, these two directories are created manually:

[[Email protected]~]# cd/usr/local/mongodb/

[Email protected]mongodb]# mkdir Data

// Create Data Catalog

[[Email protected]mongodb]# mkdir logs// Create log directory

After the creation is complete, to change the owning group of the MongoDB directory and the owning master to the MongoDB user just added, prevent the error caused by the permission problem.

[Email protected]local]# chown-r Mongodb:mongodb mongodb/


V. Setting up MongoDB service to boot with system

Edit the /etc/rc.local file and insert the following record in the file:

/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/--logpath=/usr/local/mongodb/logs/logs–fork


Six, open MongoDB Service

[[Email protected]data]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/--logpath=/usr/local/ Mongodb/logs/logs–fork


Vii. Client Login to MongoDB database

[[Email protected]data]#/usr/local/mongodb/bin/mongo

Mongodbshell version:2.6.4

Connectingto:test

>

At this point,mongodb construction work is basically completed.

Build MongoDB service based on CentOS 6.5 operating system

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.