Mongodb mongod startup parameters

Source: Internet
Author: User
Tags unix domain socket
This article lists some startup parameters that can be used when the mongod service is started, and describes the meanings of these parameters. The Mongodb startup command mongod parameters indicate that mongod has the following main parameters: * ************************************ basic configuration * **************************************** * *** -- quiet # quiet

This article lists some startup parameters that can be used when the mongod service is started, and describes the meanings of these parameters. The Mongodb startup command mongod parameters indicate that mongod has the following main parameters: * ************************************ basic configuration * **************************************** * *** -- quiet # quiet

This article lists some startup parameters that can be used when the mongod service is started, and describes the meanings of these parameters.


Mongodb startup command mongod parameter description

The main parameters of mongod include:

* ************************************ Basic configuration * **************************************** ****

-- Quiet # Quiet output
-- Port arg # Specify the service port number. The default port is 27017.
-- Bind_ip arg # Bind a service IP address. If 127.0.0.1 is bound, only local access is allowed.
-- Logpath arg # Specify the MongoDB log file. Note that the specified file is not a directory.
-- Logappend # Using the append method to write logs
-- Pidfilepath arg # Complete PID File path. If no PID File is set, no PID File exists.
-- KeyFile arg # The full path of the Cluster's private key, which is only valid for the Replica Set architecture
-- UnixSocketPrefix arg # UNIX domain socket replacement directory (/tmp by default)
-- Fork # Run MongoDB as a daemon and create a server process
-- Auth # Enable verification
-- Cpu # Periodically Display CPU usage and iowait
-- Dbpath arg # Specify the database path
-- Diaglog arg # Diaglog option 0 = off 1 = W 2 = R 3 = both 7 = W + some reads
-- Directoryperdb # Set that each database will be saved in a separate directory
-- Journal # Enable the log option. MongoDB data operations will be written to the files in the journal folder.
-- JournalOptions arg # Enable log Diagnosis
-- Ipv6 # Enable IPv6
-- Jsonp # Allow JSONP access over HTTP (with security impact)
-- MaxConns arg # The maximum number of simultaneous connections is 2000 by default.
-- Noauth # Disable Verification
-- Nohttpinterface # Disable the http interface. Access from Port 27018 is disabled by default.
-- Noprealloc # Disable data file pre-distribution (often affecting performance)
-- Noscripting # Disabling the Script Engine
-- Notablescan # Table scan not allowed
-- Nounixsocket # Disable Unix socket listening
-- Nssize arg (= 16) # Set the mail database. ns file size (MB)
-- Objcheck # Check the validity of the received customer data,
-- Profile arg # File parameter 0 = off 1 = slow, 2 = all
-- Quota # Limit the number of files in each database. The default value is 8.
-- QuotaFiles arg # Number of files allower per db, requires -- quota
-- Rest # Enabling simple rest APIs
-- Repair # Run repair on all dbs
-- Repairpath arg # Fix the directory of the file generated by the database. The default directory name is dbpath.
-- Slowms arg (= 100) # Value of slow for profile and console log
-- Smallfiles # Use a small default file
-- Syncdelay arg (= 60) # The number of seconds in which data is written to the disk (0 = never, not recommended)
-- Sysinfo # Print some diagnostic system information
-- Upgrade # If you need to upgrade the database

* ****************************** Replicaton ******* **************************************** ***

-- Fastsync # Enable the slave database replication service from a dbpath. The database of this dbpath is a snapshot of the master database and can be used to quickly enable synchronization.
-- Autoresync # If the data synchronization between the slave database and the master database is much worse, the system automatically synchronizes the data again,
-- OplogSize arg # Set the oplog size (MB)

* ******************************* Master/Slave parameters **** **************************************** ********

-- Master # Master database mode
-- Slave # Slave database mode
-- Source arg # Slave database port number
-- Only arg # Specifying a single database copy
-- Slavedelay arg # Set the delay time for synchronizing data from the slave database to the master database

* ********************************* Replica set (Replica set) option ************************************

-- ReplSet arg # Set replica Set Name

* ******************************** Sharding) option *************************************** ***


-- Configsvr # Declare that this is the config service of a cluster. The default port is 27019, and the default directory is/data/configdb.
-- Shardsvr # Declare that this is a cluster shard. The default port is 27018.
-- NoMoveParanoia # Disable storage of moveChunk data

**************************************** **************************************** ************


# The above parameters can all be written into the mongod. conf configuration file, for example:

Dbpath =/data/mongodb
Logpath =/data/mongodb. log
Logappend = true
Port = 27017
Fork = true
Auth = true


The preceding section lists the startup parameters and their meanings for future use.

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.