MongoDB (6): Simple configuration, environment variables, shutdown service

Source: Internet
Author: User

1.mongodb.conf (simple parameter configuration, see http://www.cnblogs.com/PheonixHkbxoic/p/5665515.html)

#mongod. conf
dbpath=/usr/local/mongodb/data/db
Logpath=/usr/local/mongodb/log/mongodb.log
Logappend=true
port=27017
Fork=true
Journal=true
Httpinterface=true
Rest=true

2./etc/rc.local

#!/bin/sh-e
#
# rc.local
#
# This script was executed at the end of each multiuser runlevel.
# Make sure the script would "exit 0" on success or any other
# Value On error.
#
# in order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#mongodb
Export mongodb= "/usr/local/mongodb"
Export mongodb_config= "--config= $MONGODB/config/mongod.conf"
Export mongodb_dbpath= "$MONGODB/data/db"
Export mongodb_logpath= "$MONGODB/log/mongodb.log"
Export path= $PATH: $MONGODB/bin
Mongod $MONGODB _config


#exit 0

2. View Mongod background process, and close (there are many ways to close, see http://www.cnblogs.com/PheonixHkbxoic/p/5665499.html)

MongoDB (6): Simple configuration, environment variables, shutdown service

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.