Build MongoDB Service Based on CentOS 6.5 Operating System

Source: Internet
Author: User
Tags install mongodb

Build MongoDB Service Based on CentOS 6.5 Operating System

MongoDB is a non-relational database (NoSQL) that is very popular in the IT industry. Its flexible data storage method is favored by current IT practitioners. MongoDB implements the object-oriented idea (OO idea), and every record in MongoDB is a Document object. The biggest advantage of MongoDB is that all data persistence operations can easily implement CRUD operations without the need for developers to manually write SQL statements.

This article uses the Linux system to build the MongoDB service. The following describes the specific setup process:

1. Prepare the MongoDB installation package

You can download the mongodbpackage at http://www.mongodb.org/downloads.

2. Prepare MongoDB users

[Root @ bkjia ~] # Useradd-s/sbin/nologin mongodb

3. Unpack and rename the decompressed directory to mongodb

[Root @ bkjia ~] # Tar-zxf mongodb-linux-x86_64-2.6.4.tgz-C/usr/src/

[Root @ bkjia ~] # Mv/usr/src/mongodb-linux-x86_64-2.6.4 // usr/local/mongodb/

4. Go to the decompressed directory

Because the mongodb directory does not contain its data storage directory and log directory, you must manually create these two directories:

[Root @ bkjia ~] # Cd/usr/local/mongodb/

[Root @ bkjia mongodb] # mkdir data

// Create a data directory

[Root @ bkjia mongodb] # mkdir logs // create a log directory

After the creation is complete, change the group and master of the mongodb directory to the mongodb user you just added to prevent errors caused by permission issues.

[Root @ bkjia local] # chown-R mongodb: mongodb/

5. Set mongodb service to start with system startup

Edit the/etc/rc. local file and insert the following records into the file:

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

6. Start the mongodb Service

[Root @ bkjia data] #/usr/local/mongodb/bin/mongod -- dbpath =/usr/local/mongodb/data/-- logpath =/usr/local/mongodb/logs /logs-fork

7. log on to the mongodb database from the client

[Root @ bkjia data] #/usr/local/mongodb/bin/mongo

MongoDB shell version: 2.6.4

Connecting to: test

>

So far, mongodb is basically complete.

CentOS compilation and installation of MongoDB

CentOS compilation and installation of php extensions for MongoDB and mongoDB

CentOS 6 install MongoDB and server configuration using yum

Install MongoDB2.4.3 in Ubuntu 13.04

MongoDB beginners must read (both concepts and practices)

MongoDB Installation Guide for Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) in English [PDF]

Nagios monitoring MongoDB sharded cluster service practice

MongoDB details: click here
MongoDB: click here

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.