CentOS 6.8 Installation MongoDB Database

Source: Internet
Author: User
Tags mongodb

Environment CentOS6.8 andmongodb4.0.1

1 Download MongoDB Package website address

Switch to/USR/LOCAL/SRC directory

[[email protected] src]# wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-4.0.1.tgz

2 Unpacking the MongoDB package

[[email protected] src]# tar -zxvf mongodb-linux-x86_64-rhel62-4.0.1.tgz// 重命名[[email protected] src]# mv mongodb-linux-x86_64-rhel62-4.0.1 mongodb

3 Configuration Files

Enter the MongoDB directory, first create the Data/db,data/logs folder

[[email protected] mongodb]# mkdir data/db[[email protected] mongodb]# mkdir data/logs

Enter the bin directory to create the mongodb.conf file

// mongodb.conf不存在就新建文件,存在就打开编辑[[email protected] bin]# vi mongodb.conf

The edit mongodb.conf file is saved as follows

dbpath = /usr/local/src/mongodb/data/dblogpath = /usr/local/src/mongodb/data/logs/mongodb.logport=27017fork=true

4 Testing

Execute start MongoDB in the bin directory ./mongod --config mongodb.conf
Input ./mongo into MongoDB console

5 Boot, edit /etc/rc.d/rc.local the file, and then restart the system

// 最后添加/usr/local/src/mongodb/bin/mongod --config mongodb.conf

6 environment variables, editing the current user .bash_profile file,

// 最后添加export MONGODB_HOME=/usr/local/src/mongodb/binexport PATH=$MONGODB_HOME:$PATH

CentOS 6.8 Installation MongoDB Database

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.