Use the following command to view the startup parameters for the service: @
Mongod--help or mongod-h.
Additional command parameters: @
* Basic configuration-------------------------------------------------------------------------------quiet # quiet Output--port arg # Specify service port number, default port 27017--bind_ip ARG # BIND service IP, if binding 1 27.0.0.1, you can only access it locally, do not specify the default local all IP--logpath arg # Specify MongoDB log file, note that the specified file is not a directory--logappend # Write log--pidfilepath the full path of ARG # PID file with Append method, if not set, then no PID file--keyfile arg # The full path of the private key of the cluster, only valid--unixsocketprefix arg # UNIX domain socket substitution directory for the replica Set schema (TMP)--fork # run MongoDB as daemon, create server process--auth # enable authentication--cpu # periodically show CPU CPU utilization and iowait--dbpath arg # Specify database path--diaglog arg # diaglog option 0=of F 1=w 2=r 3=both 7=w+some reads--DIRECTORYPERDB # Setup Each database will be saved in a separate directory--journal # Enable logging options, MONGODB data operationswill be written to the file in the Journal folder--journaloptions Arg # Enable log diagnostics option--ipv6 # enable IPV6 option--jsonp # allows the Jsonp form to be accessed via HTTP (with security implications)--maxconns ARG # Maximum simultaneous connection number default--noauth # Do not enable authentication--nohttpinterface # Close HTTP interface, default turn off 27018 port Access--noprealloc # Disable data file pre-allocation (often impacting performance)--noscripting # Disable script engine--notablescan # does not allow table scans--nounixsocket # Disable UNIX socket Listener--nssize arg (=16) # Set letter database. ns file Size (MB)--objcheck # in receipt of customer data, check validity,--p Rofile arg # file Parameters 0=off 1=slow, 2=all--quota # Limit the number of files per database, set defaults to 8--quota Files arg # Number of files Allower per db, requires--quota--rest # Open Simple res T API--repair # Repair The directory of files generated by all database run repair on the all DBS--repairpath arg # Repair Library, default Think directory name DBPath--slowmsArg (=100) # Value of slow for profile and console log--smallfiles # uses a smaller default file--syncdela Y-Arg (=60) # Number of seconds to write to disk (0=never, not recommended)--sysinfo # Print Some diagnostic system Information--upgrade # If you need to upgrade the database * Replicaton parameters-------------------------------------------------------------------------------FA Stsync # from a dbpath the Library Replication service is enabled, and the DBPath database is a snapshot of the main library that can be used to quickly enable synchronization--autoresync # If you are from the library with the main Library sync data is much worse, automatically resynchronization,--oplogsize arg # set Oplog size (MB) * Main/from parameter-------------------------------------------- -----------------------------------Master # Main Library Mode--slave #--SO from library mode Urce ARG # Specifies a single database replication--slavedelay arg # from the Library port number--only arg # settings from the library Synchronization Main Library Latency * Replica set (replica set) option:-------------------------------------------------------------------------------Rep LSet Arg # set Replica set name * Sharding (fragment) option-------------------------------------------------------------------------------Config SVR # declaration This is a cluster config service, default port 27019, default directory/data/configdb--shardsvr # Declares this is a cluster of fragments, the default end Mouth 27018--nomoveparanoia # Close paranoid for movechunk data save?
The above parameters can be written to the mongod.conf configuration document for example: @
DBPath =/data/mongodb
logpath =/data/mongodb/mongodb.log
Logappend = true
port = 27017 Fork
= True
Auth = True
Original address: http://www.hiceon.com/topic/mongodb-startup-parameters/