Installing MongoDB in the CentOS system environment

Source: Internet
Author: User
Tags mongodb download time interval

(1) Go to MongoDB Download Center : http://www.mongodb.org/downloadsWe recommend using these binary distributions (binary version is officially recommended) !) (2) according to their actual system environment , download the required files, mine is the Linux 64-bit.
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.3.tgz
then unzip :
Tar zxvf mongodb-linux-x86_64-2.2.3.tgz
Move directory to /usr/local/mongodb
Mv-f mongodb-linux-x86_64-2.2.3/*/usr/local/mongodb
Go to the MongoDB directory
Cd/usr/local/mongodb
New Custom Data Catalog
Mkdir-p./data/db/
New log Directory
mkdir logs
Next Run mode start MongoDB
/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/mongodb/logs/mongodb.log- -fork
Show
View sourceprint?forked process:18261all output going to:/usr/local/mongodb/logs/mongodb.loglog file [/usr/local/ Mongodb/logs/mongodb.log] exists; copied to temporary file [/usr/local/mongodb/logs/mongodb.log.2013-03-01t04-04-28]child process started successfully, Parent exiting
To set up boot from:
echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/mongodb/logs/ Mongodb.log--fork ">>/etc/rc.local
View MongoDB Logs
Tail-f/usr/local/mongodb/logs/mongodb.log
To view or incorrectly view MongoDB processes on the run of MongoDB
PS aux |grep MongoDB
Show
Root     18261  0.0  1.4 150392 29948?        Sl   12:04   0:00/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/db--logpath=/usr/local/ Mongodb/logs/mongodb.log--fork
parameter explanation :--dbpath database path (data file)--logpath log file path--master designated as the primary machine--slave designated as the IP address of the host machine--source Specifies that the log file size does not exceed 64M. Because the resync is extremely operational and time consuming, it is best to avoid resync by setting a large enough oplogsize (the default oplog size is 5% of the free disk size). --logappend log file at the end of the Add--port enable port number--fork run in the background--only specify which database to replicate only--slavedelay refers to the time interval from replication detection--auth Whether authentication permission is required to log on (user name and password)

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.