MongoDB Installation Record

Source: Internet
Author: User
Tags mkdir mongodb mongodb book

Recently has been looking at MongoDB book, but the practice is not much, today at noon using the rest, the virtual machine was installed, operating system for cent OS 6.2 (64-bit). The following records are as follows;

1 Download the installation package to the/home/software directory

wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.2.tgz


2 Extract the program to the current directory

Tar xzvf mongodb-linux-x86_64-2.2.2.tgz

3 Install the program into the/usr/local directory (note/usr/local/mongodb This directory must exist)

MV Mongodb-linux-x86_64-2.2.2/usr/local/mongodb

4 Creating a configuration file

Vim/etc/mongodb.conf

5 Modify the configuration file contents as follows

Logpath=/usr/local/mongodb/log/mongodb.log
logappend=true
fork=true
dbpath=/usr/local/mongodb/data
port=27017

6 Create data directory and log directory files according to the configuration file

Mkdir/usr/local/mongodb/data
mkdir/usr/local/mongodb/log
vim    /usr/local/mongodb/log/mongodb.log

7 Creating a startup script

Vim/usr/local/mongodb/start_mongodb

8 Modify the contents of the startup script to read as follows:

#。 /bin/sh
/usr/local/mongodb/bin/mongod--config/etc/mongodb.conf

9 Modify the Startup script permissions:

chmod +x/usr/local/mongodb/start_mongodb

10 Starting the database

./usr/local/mongodb/start_mongodb

In this case, you will see the prompt to start success, in addition to our launch script can be placed in the/usr/bin directory, so that we can directly start MongoDB in any location, if you have any problems in the installation, I would like to solve for everyone.



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.