Mongodb startup command mongod parameter description

basic configuration



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



--quiet # quiet output
--port arg # Specify the service port number, the default port is 27017
--bind_ip arg # Bind the service IP. If you bind to 127.0.0.1, you can only access it locally. Do not specify all the default local IPs.
--logpath arg # Specify the MongoDB log file, note that the specified file is not a directory
--logappend # write log using append
--pidfilepath arg # The full path of the PID File, if not set, there is no PID file
--keyFile arg # The full path to the private key of the cluster, only valid for Replica Set architecture
--unixSocketPrefix arg # UNIX domain socket alternative directory, (defaults to /tmp)
--fork # Run MongoDB as a daemon and create a server process
--auth # enable validation
--cpu # Periodically display the CPU utilization and iowait of the CPU
--dbpath arg # Specify the database path
--diaglog arg # diaglog选项 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 the journal option, MongoDB data operations will be written to the files in the journal folder
--journalOptions arg # Enable log diagnostic options
--ipv6 # enable IPv6 options
--jsonp # Allow JSONP access via HTTP (with security implications)
--maxConns arg # The maximum number of simultaneous connections defaults to 2000
--noauth # disable validation
--nohttpinterface # Close the http interface, the default port 27018 is closed
--noprealloc # Disable datafile preallocation (often affects performance)
--noscripting # disable script engine
--notablescan # Disallow table scans
--nounixsocket # Disable Unix socket listening
--nssize arg (=16) # Set the letter database.ns file size (MB)
--objcheck # After receiving customer data, check the validity,
--profile arg # File parameters 0=off 1=slow, 2=all
--quota # Limit the number of files per database, the default setting is 8
--quotaFiles arg # number of files allower per db, requires --quota
--rest # Enable simple rest API
--repair # Repair all databases run repair on all dbs
--repairpath arg # Repair the directory of the files generated by the library, the default is the directory name dbpath
--slowms arg (= 100) # value of slow for profile and console log
--smallfiles # use smaller default file
--syncdelay arg (= 60) # The time in seconds for data to be written to disk (0=never, not recommended)
--sysinfo # print some diagnostic system information
--upgrade # If you need to upgrade the database

* Replicaton parameter



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



--fastsync # Enable the slave library replication service from a dbpath whose database is a snapshot of the master library, which can be used to quickly enable synchronization
--autoresync # Automatically resynchronize if the slave is much worse than the master sync data,
--oplogSize arg # Set oplog size (MB)

* Master/Slave parameters



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



--master # main library mode
--slave # Slave mode
--source arg # Slave port number
--only arg # Specify single database replication
--slavedelay arg # Set the delay time for the slave library to synchronize the master library

* Replica set options:



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



--replSet arg # Set the replica set name

* Sharding option



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


--configsvr # Declare this as a cluster config service, default port 27019, default directory /data/configdb
--shardsvr # declare that this is a cluster shard, default port 27018
--noMoveParanoia # Turn off paranoia for moveChunk data saving

# All of the above parameters can be written into the mongod.conf configuration file. 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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326671429&siteId=291194637