MongoDB Start Command mongod parameter description

Source: Internet
Author: User
Tags unix domain socket

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, then only native access, do not specify default local all IP

--logpath arg# Specifies the MongoDB log file, note that the specified file is not a directory

--logappend# Write a log using an Append method

--pidfilepath Arg# The full path of the PID file, if not set, there are no PID files

--keyfile Arg# The full path of the private key of the cluster, valid only for the replica Set schema

--unixsocketprefix arg# 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

--dbpath arg# Specifies the database path

--diaglog arg# 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

--journaloptions arg# Enable log diagnostics option

--ipv6# enable IPV6 option

--jsonp# allows JSONP form to be accessed via HTTP (with security implications)

--maxconns arg# maximum simultaneous connections default of 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# Disabling 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 parameter 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# repair all databases run repair on all DBS

--repairpath arg# Fix 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

--oplogsize arg# Setting the size of Oplog (MB)


* Master/slave parameters

--master# Main Library mode

--slave# from Library mode

--source Arg# from the library port number

--only arg# Specifies a single database copy

--slavedelay arg# Setting the delay time for synchronizing the main library from the library


* Replica set (replica set) option:

--replset arg# Sets 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/mongo Db/logs/shard1a.log-logappend-fork-rest


This article is from the "Intelligent Future _XFICC" blog, please be sure to keep this source http://xficc.blog.51cto.com/1189288/1617614

MongoDB Start Command mongod parameter description

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.