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