MongoDB Start Command mongod parameter description

Source: Internet
Author: User
Tags auth unix domain socket

The main parameters of Mongod are:

Basic Configuration

--------------------------------------------------------------------------------

--quiet # Quiet Output
--portarg # Specify the service port number, default port 27017
--BIND_IPARG # Bind Service IP, if bind 127.0.0.1, then only native access, do not specify default local all IP
--logpatharg # Specifies the MongoDB log file, note that the specified file is not a directory
--logappend # Write a log using an Append method
--pidfilepatharg # The full path of the PID file, if not set, there are no PID files
--keyfilearg # Full path to the private key of the cluster, valid only for the replica Set schema
--unixsocketprefixarg # UNIX domain socket replacement directory (default =/tmp)
--fork # running MongoDB as a daemon, creating a server process
--auth # Enable Validation
--CPU # Periodically displays CPU utilization and iowait for CPUs
--dbpatharg # Specifying the database path
--diaglogarg # diaglog option 0=off 1=w 2=r 3=both 7=w+some reads
--DIRECTORYPERDB # Set each database to be saved in a separate directory
--journal # Enable logging option, MONGODB data operations will be written to the files in the Journal folder
--journaloptionsarg # Enable Log diagnostics option
--ipv6 # Enable IPV6 option
--JSONP # allows JSONP form to be accessed via HTTP (with security implications)
--maxconnsarg # Maximum number of simultaneous connections default 2000
--noauth # do not enable validation
--nohttpinterface # Turn off HTTP interface, turn off 27018 port access by default
--noprealloc # Disabling data file pre-allocation (often impacting performance)
--noscripting # Disabling the scripting engine
--notablescan # do not allow table scans
--nounixsocket #禁用Unix套接字监听
--nssize Arg (=16) # Set the message database. ns File Size (MB)
--objcheck # in the receipt of customer data, check the validity of
--profilearg # File Parameters 0=off 1=slow, 2=all
--quota # Limit the number of files per database, set default to 8
--quotafilesarg # Number of files Allower per db, Requires--quota
--rest # Open a simple rest API
--repair # repair All databases run repair on all DBS
--repairpatharg # Fix the directory of files generated by the library, default to directory name DBPath
--slowms Arg (=100) # Value of slow for profile and console log
--smallfiles # using a smaller default file
--syncdelay Arg (=60) # Number of seconds data written to disk (0=never, not recommended)
--sysinfo # Print Some diagnostic system Information
--upgrade # If you need to upgrade your database
* Replicaton Parameters

--------------------------------------------------------------------------------

--fastsync # from a dbpath to enable the Copy service from the library, the DBPath database is a snapshot of the main library and can be used to quickly enable synchronization
--autoresync # If synchronizing data from the library to the main library is much worse, automatic resynchronization
--oplogsizearg # Setting the size of Oplog (MB)
* Master/slave parameters

--------------------------------------------------------------------------------

--master # Main Library mode
--slave # from Library mode
--sourcearg # from the library port number
--onlyarg # Specifying a single database copy
--slavedelayarg # Setting the delay time for synchronizing the main library from the library

* Replica set (replica set) option:

--------------------------------------------------------------------------------

--replsetarg # Set the replica set name
* sharding (Shard) option

--------------------------------------------------------------------------------

--CONFIGSVR # Declare this is a clustered config service, default port 27019, default directory/data/configdb
--shardsvr # declares that this is a clustered shard, the default port 27018
--nomoveparanoia # Turn off paranoid for movechunk data save?

# The above parameters can be written in the mongod.conf configuration document for example:

DBPath =/data/mongodb

LogPath =/data/mongodb/mongodb.log

Logappend = True

Port = 27017

Fork = True

Auth = True

E.g:./mongod-shardsvr-replset Shard1-port 16161-dbpath/data/mongodb/data/shard1a-oplogsize 100-logpath/data/ Mongodb/logs/shard1a.log-logappend-fork-rest

Http://blog.sina.com.cn/s/blog_6fb90ed30100u6ko.html

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.