This article lists some of the startup parameters that the Mongod service can use when it starts, and describes the meaning of the parameters.
MongoDB Start Command mongod parameter description
The main parameters of Mongod are:
Basic Configuration *********************************************
--quiet |
# quiet Output |
--port Arg |
# Specify the service port number, default ports 27017 |
--BIND_IP Arg |
# Bind service IP, if bind 127.0.0.1, can only native access, do not specify default local all IP |
--logpath Arg |
# Specify the MongoDB log file, note that the specified file is not a directory |
--logappend |
# Write a log using append |
--pidfilepath Arg |
# The full path of the PID file, if not set, there are no PID files |
--keyfile Arg |
# The full path of the cluster's private key, valid only for the replica Set schema |
--unixsocketprefix Arg |
# UNIX domain Socket Alternative directory, (default =/tmp) |
--fork |
# run MongoDB as a daemon and create a server process |
--auth |
# Enable Validation |
--cpu |
# Periodic display of CPU utilization and iowait |
--dbpath Arg |
# Specify Database path |
--diaglog Arg |
# Diaglog Options 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 operation will be written to the file in the Journal folder |
--journaloptions Arg |
# Enable Log Diagnostics options |
--ipv6 |
# Enable IPV6 option |
--jsonp |
# Allow JSONP form to be accessed via HTTP (with security implications) |
--maxconns Arg |
# Maximum number of simultaneous connections default 2000 |
--noauth |
# Do not enable validation |
--nohttpinterface |
# Close the HTTP interface and turn off 27018 port access by default |
--noprealloc |
# Disable data file pre-allocation (often impacting performance) |
--noscripting |
# Disable scripting engine |
--notablescan |
# No table scan allowed |
--nounixsocket |
# Disable UNIX socket snooping |
--nssize Arg (=16) |
# Set the message database. ns File Size (MB) |
--objcheck |
# in the receipt of customer data, check the validity of |
--profile Arg |
# file Parameters 0=off 1=slow, 2=all |
--quota |
# limit the number of files per database, set default to 8 |
--quotafiles Arg |
# Number of files Allower per db, requires--quota |
--rest |
# Open a simple rest API |
--repair |
# fix all databases run repair on all DBS |
--repairpath Arg |
# Fix the directory of the files generated by the library, default to directory name DBPath |
--slowms Arg (=100) |
# Value of slow for profile and console log |
--smallfiles |
# Use 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**************************************************
--fastsync |
# enable from the Library Replication Service from a dbpath, 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, |
--oplogsize arg |
# setting Oplog size (MB) |
* master/slave parameters ****************************************************
--master |
# Main Library mode |
--slave |
# from library mode |
--source arg |
# from library port number |
--only arg |
# Specify a single database copy |
-- Slavedelay arg |
# set the delay time to synchronize the main library from the library |
Replica Set (replica set) option ************************************
--replset Arg |
# set Replica set name |
********************************sharding (shard) option ******************************************
--configsvr |
# declares that 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 paranoia 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
Above, the startup parameters and their meanings are enumerated for the next use of the view.
Mongod start parameter description in MongoDB