CentOS Installation Configuration MongoDB

Source: Internet
Author: User
Tags mongodb support

1. To download the installation package:

Java code
    1. wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.3.tgz



2. Extract:

Java code
    1. TAR-ZXVF mongodb-linux-i686-2.0. 3.tgz



3. Specify the installation directory:

Java code
    1. MV mongodb-linux-i686-2.0. 3.tgz/usr/local/mongodb



4. New MongoDB Data File storage directory:

Java code
    1. Mkdir-p/data0/mongodn/db



5. New log file storage directory:

Java code
    1. Mkdir-p/data0/mongodn/logs



6.

Java code
    1. Cd/usr/local/mongodb/bin



7. New configuration file, MongoDB support to write the parameters into the configuration file, and then the configuration file configuration to start, we also use this method here. Perform:

Java code
    1. VI mongodb.conf


Add the following:

Java code
    1. DBPath =/data0/mongodb/db #数据文件存放目录
    2. LogPath =/data0/mongodb/logs/mongodb.log #日志文件存放目录
    3. Port = 27017 #端口
    4. Fork = true #以守护程序的方式启用, which runs in the background
    5. Nohttpinterface = true


Rebind the configuration file address and access IP for MongoDB:

Java code
    1. /usr/local/mongodb/bin/mongod--bind_ip localhost-f/usr/local/mongodb/bin/mongodb.conf



8. Start the MONGO program, start with the parameters defined by the configuration file mongodb.conf

Java code
    1. ./mongod--config mongodb.conf



9. Test, OK, installation successful!



MongoDB Installation Reference http://gevin.me/289.html


Boot auto Start MongoDB
Perform:

Java code
    1. Vi/etc/rc.d/rc.local



In the file, add:

Java code
      1. /usr/local/mongodb/bin/mongod--config/usr/local/mongodb/bin/mongodb.conf

CentOS Installation Configuration 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.