MongoDB configuration file description)

Source: Internet
Author: User
Tags disk usage

IntroductionBytes ¶

Administrators and Users can control MongoDB or mongos instances fromMongodCommand Line ParametersOr use the configuration file to modify.

Although the two methods are functionally equivalent and all settings are similar, the configuration file method is desirable. If you have installedControl scriptYou are using a configuration file.

To start mongod or mongos, use one of the following forms:

Mongod -- config/etc/MongoDB. conf

Mongod-F/etc/MongoDB. conf

Mongos -- config/srv/MongoDB/mongos. conf

Mongos-F/srv/MongoDB/mongos. conf

Use the following table for all settings declared in this file:

<Setting >=< value>

In the new 2.0 version:InRelease 2.0Before, Boolean (such as true | false) or "flag" parameters, registered as true, if they appear in the configuration file, regardless of their value.

SetBytes ¶

Verbose analyze ¶

Default Value:False

Added a large number of log paths generated in the standard output or log files returned by internal reports.

V Branch ¶

Default Value:False

Another form of detail.

VV flood ¶

Default Value:False

Additional output and log details.

Vvv used ¶

Default Value:False

Additional output and log details.

Variable of vvvv ¶

Default Value:False

Additional output and log details.

Vvvvv restart ¶

Default Value:False

Additional output and log details.

Quiet Networks ¶

Default Value:False

Try to limit the output in a quiet running mongod or mongos instance mode. This option is disabled:

  • DATABASE CommandOutput, including drop, dropindex, diaglogging, verification, cleaning
  • Copy activity.
  • Connection acceptance event.
  • Connection Close event.

Port numbers ¶

Default Value:27017

Listen to the instance connected by the client for the specified TCP port of mongod or mongos. Root permission is required for ports with Unix-like system numbers lower than 1000.

Bind_ip Subnet ¶

Default:All interfaces.

Set this option to configure mongodmongos process binding and listening to applications connected from this address. You can connect to mongod or mongos with any interface. However, if you attach an interface that can be publicly accessed during the process, you can implement correct authentication or firewall restrictions, to protect the integrity of your database.

You can connect to a comma-separated value list to bind multiple IP addresses.

Maxconns APIs ¶

Default Value:It depends on the system (that is, the ulimit and file descriptor), unless the set MongoDB does not limit its own connection.

Specify a value to set the maximum number of simultaneous mongos connections during the environment court hearing, the judge and the Environment Committee fully reconsider the entire application based on the previous evidence. This setting has no effect. If it is higher than the maximum connection trace configured in your operating system, threshold

This is especially useful for mongos. If you have a client that creates a collection but allows them to time out, rather than close the collection. When you set maxconns, make sure that the value is slightly higher than the size of the connection pool, or the total number of connections from the spread member to prevent incorrect connection spikesFragmentGroup.

Objcheck failed ¶

Default Value:False

Set to true, and force mongod to verify all requests from the client to ensure thatBsonObjects will never be inserted into the database. Mongod does not enable this default scenario because of the required overhead.

Logpath Logging ¶

Default Value:None. (In/dev/stdout)

The specified log file that stores the path diagnostic log records of all file names.

Unless otherwise specified, mongod outputs all log information to the standard output. Unless logappend is true, the log file will be overwritten and restarted.

Others

Currently, the content of log files in MongoDB will be overwritten if logappend is not used. The result of this behavior may change depends on the future server-4499.

Logappend consumer ¶

Default Value:False

If this parameter is set to true, a new log file is added, instead of the content of the log when the log is overwritten and restarted.

If this setting is not specified, MongoDB overwrites existing log files at startup.

Others

In the near future, the behavior record system may change to server-4499 in the future.

Syslog collector ¶

All logs are output to the hostSystem LogsSystem, rather than standard output or log file and Log Path.

Warning

You cannot use system logs and log paths.

Pidfilepath plugin ¶

Default Value:None.

"PID"Or process idmongod process. It is useful for tracking the Combined Cross settings in the mongod process.

Without this option, mongod creates the PID file.

Keyfile Encoding ¶

Default Value:None.

The path of the specified key file stores authentication information. This option is only applicable to members of the connected sub-sets.

See.

"Copy setting Security"And"Replica set management. "

Nounixsocket timeout ¶

Default Value:False

Set to true to disable listening on UNIX sockets. Unless set to false, mongod and mongos provide UNIX sockets.

Unixsocketprefix delimiter ¶

Default Value :/Tmp directory

The path of the specified UNIX socket. Unless the value of this option is mongod mongos, create a socket/tmp as the prefix.

Fork Signature ¶

Default Value:False

Enabled if set to trueDaemonRunning background.

Auth Authentication ¶

Default Value:False

If this parameter is set to true, database user authentication is enabled for connections from remote hosts. Configure the user throughMongoIf the shell has no user, the local host interface will continue to access the database until the first user you created.

CPU quota ¶

Default Value:False

Set to true and force mongod to submit a 4-second report on CPU usage and time. The processor waits for the I/O operation to complete (that is, the I/O wait .) MongoDB writes: if the data used is output to the standard output or the Log Path of the log file is selected.

Dbpath Signature ¶

Default:/Data/DB/

Set this value to the mongod instance in the specified directory to store its data. Typical regions include:/srv/MongoDB/var/lib/MongoDB or/opt/MongoDB

Unless otherwise specified, mongod will find the default/data/DB directory in the data file. (Use the \ data \ dB directory in windows .) If you have entered SQL query in the installation package. Check the dbpath configuration of your package in the/etc/MongoDB. conf file.

Diaglog Functions ¶

Default Value: 0

Create a very detailed troubleshooting andDiagnostic logRecord various errors. Write a series of files starting with a string in the dbpath directory of these log files in MongoDB, and append the diaglog start time record to a hexadecimal string.

The value of this setting configures the possible value of the Level detail, which has the following impact:

{0} {/0} Value

Set

0th days

Discount! No records.

1

Log write operation.

2

Log reading.

3

Log read and write operations.

7

Log writing and some read operations.

Replay output. You can use the dig sniff tool for investigation. A typical diaglog file is located in/data/DB/diaglog.4f76a58c. You can use a command to read these files in the following table:

Mongosniff -- source diaglog/data/DB/diaglog.4f76a58c

Diaglog is used internally and is not used as the most user.

Warning

The diagnostic level is set to 0, which will cause the end of mongod.Diagnostic logFile write data. However, the mongod instance will continue to open the file even if it no longer writes data to the file. If you want to rename, move, or delete diagnostic logs, you must completely shut down the mongod instance before doing so.

Directoryperdb Connector ¶

Default Value:False

Set to true. The storage mode in the modified data directory stores the files of each database in different folders. This option is named every directory created in dbpath.

Use this option in conjunction with your file system and device MongoDB configuration to increase the write throughput or disk capacity of data stored on several different disk devices.

Journal logs ¶

Default:(On 64-bit Systems) True

Default:(On 32-bit Systems) False

If this parameter is set to true, operation logs are enabled to ensure write durability and data consistency.

Set to false to prevent the overhead of logs from being durable. To reduce the impact on the disk usage of logs, you can enable the magazine and set it to true to reduce the size of smallfiles and log files.

Journalcommitinterval Interval ¶

Default Value:100

Set this value to the log operation allowed between the specified time limit and D. The default value is 100 milliseconds. The lower the value, the more durable the magazine's disk performance at the lowest possible cost.

This option takes a value between 2 and 300 milliseconds.

To force mongod to submit logs more frequently, you can specify "J:" true ". When J: The real write operation is pending, mongod will reduce the value of journalcommitinterval by 1/3.

IPv6 Subnet ¶

Default Value:False

Set to true. IPv6 support allows clients to connect to ipvd to prohibit IPv6 networks. Ipvd and all tools are supported by IPv6 by default.

Jsonp response ¶

Default Value:False

If set to true, allowJsonpYou can use the HTTP access interface to consider security issues before setting this option for this activity.

Noauth authorization ¶

Default Value:True

Disable authentication. Current default value. Compatibility and clarity exist for the future.

The authentication option used to maintain consistency.

Nohttpinterface restart ¶

Default Value:False

Set to true to disable the HTTP interface. This command overwrites the rest and disables the HTTP interface if you specify at the same time.

Changed in version 2.1.2: The nohttpinterface option is only 2.1.2 when mongos is unavailable.

Nojournal internal ¶

Default Value :(64Bit System) False

Default Value :(32Bit system ).

Set nojournal = true to disable persistent logs. By default, mongod can be later than 2.0 in the 64-bit version.

Noprealloc failed ¶

Default Value:False

Set noprealloc = true to disable pre-allocated data. Its format is the same as that of shell path settings: multiple path names are separated by colons (use semicolons in Windows ). this will shorten the startup time in some cases, but can cause significant performance loss during normal operations.

Noscripting Logging ¶

Default Value:False

Set noscripting = true to disable the script engine.

Notablescan failed ¶

Default Value:False

Set notablescan = true to disable table scan.

Nssize limit ¶

Default Value:16

Specify this value (in MB ).

Use this setting to control all newly created default-size namespaces (NS ). Does this option affect the size of the existing namespace file.

The default value is 16 MB, which provides a valid namespace of 12000. The maximum size is 2 GB.

Profile Statistics ¶

Default Value: 0

Modify the horizontal database analysis of this value, and insert the business performance information to the output mongod or the specified log file, if the Log Path. The following levels are available:

Level

Set

0th days

Off. No analysis.

1

Only slow operations are included.

2

Enable all operations.

By default, analytics is disabled by mongod. Database analysis may affect the performance of the database because the probe must record and process all database operations. When this option is enabled, consider it carefully.

Quota quota ¶

Default Value:False

Set to true so that each database can have a maximum of digital data files. The default quota is 8 data files, when the quota is real. Adjust quotafiles settings for the quota size.

Quotafiles templates ¶

Default Value:8

Modify the limit on the number of data files in each database. This option requires quota settings.

Rest APIs ¶

Default Value:False

If set to true, to make a simpleRestInterface.

Repair restart ¶

Default Value:False

Set to true. After the repair program is executed, start all databases. In general, you should set this option on the command line.NoInConfiguration FileOr inControl script.

UseMongod-RepairTo access the function.

Others

Because mongod overrides all the database files in the repair process program, if you do not run the repair mongod normally runs in the same user account, your database files, you will need to run chown to correct the permission and then start mongod again.

Repairpath Signature ¶

Default:Dbpath

The directory where the data file in the specified path is located.Mongod-RepairOperation. The default value is dbpath.

Slowms restart ¶

Default Value:100

The value in milliseconds.

The threshold D is used to check the slow database. The database records all slow query logs, even if the probe is not enabled. When the database analyzer is, the mongod analyzer is written to the system. profile set.

See.

: Profile

Smallfiles APIs ¶

Default Value:False

Set to true. Modify the default data of MongoDB {0} file {/0} {1 }. size () {/1} specifically, smallfiles reduces the initial usage of data files and their size limit to 512 <MSG name = "unit_mb"> MB </MSG> smallfiles settings also reduce the size of eachMagazines1 GB to 128 MB.

If you have a large number of databases, use smallfiles to set each of them to hold a small amount of data. Smallfiles settings cause mongod to create many files, which may affect the performance of the database.

Syncdelay restart ¶

Default Value: 60

This setting controls the maximum number of seconds between refresh to be written to the disk. Mongod always writes data to the disk. This setting controls the maximum number of successful write operations and the next interval between the databases to refresh the data to the disk.

In many cases, the write operation and disk refresh ratio between actual time intervals are shorter.

If it is set to 0, mongod immediately refreshes all operations to the disk, which can have a significant performance impact. If the diary is true, all write operations will be persistent, and the journalcommitinterval by the magazine within the specified time.

Sysinfo producer ¶

Default Value:False

If it is set to true, mongod returns the page size information of the diagnosis system, the number of physical pages, and the available physical pages to the standard output.

TypicallyMongod-sysinfoOf<Command> when sysinfo and mongod are running, only the page information is output, and the process starts if no database exists.

Upgrade quota ¶

Default Value:False

When this option is set to true, the data format on the disk is upgraded from dbpath to the latest specified file version, if necessary.

This option only affects the operation of the mongod data file in an old format.

This option is updated when the specified mongos instance is used.Configure the databaseMetadata format.

Others

In most casesNoYou should set this value so that you can exercise maximum control over your upgrade process. For more information about the upgrade process, see the MongoDB release instructions (download page.

Traceexceptions ¶

Default Value:False

For internal diagnostics.

Copy OptionBytes ¶

Replset Lifecycle ¶

Default Value:<None>

Form:<Setname>

This setting is used to configure replica sets to specify the name of the replica group as the parameter. All Hosts must have the same group name.

See.

Copy"Replica set management,"Replica Set Configuration"

Oplogsize quota ¶

The maximum size (in MB) specified by the copy operation (for exampleOplog). Mongod creates an oplog based on the maximum available space. For 64-bit systems, the oplog is generally 5% of the available disk space.

Once mongod has been created for the oplog time, changing the oplogsize will not affect the oplog size.

Fastsync resume ¶

Default Value:False

InReplica setIn the case of replication, set this option to true if you have been vaccinated with the snapshot of the copyDbpath. Otherwise, mongod will try to perform full synchronization.

Warning

If the data has not been perfectly synchronizedAndMongod starts with fastsync and then secondary school or slave station will never sync Primary School, which may cause significant consistency issues.

Replindexprefetch success ¶

In the new version 2.2.

Default Value:All

Value:All, no, _ id_only

You must use replindexprefetch in combination with replset.

By default,Level 2OfReplica setThe oplog operation applied before all related metrics loaded to the memory by the Member. You can modify this behavior to help attach only the _ id index. Specify _ id_only or none to prevent mongodAnyThe index is loaded into the memory.

Master/Slave ReplicationBytes ¶

Master slave ¶

Default Value:False

Set to true as in the current instance copy configurationMasterInstance.

Slave finished ¶

Default Value:False

Set to true as the current instanceSlaveFor example, copy the configuration.

Source Region ¶

Default:<>

Form:<Host>: <port>

The slave settingsMasterInstance,SlaveThe instance will be copied

Only available ¶

Default:<>

Specify only oneDatabase.

Slavedelay restart ¶

Default Value: 0

Slavedelay configures a "delay" in seconds for the settings and use of slaves.MasterInstance operation.

Autoresync Enabled ¶

Default Value:False

Set autoresync.Slaves, Automatically re-sync for more than 10 seconds, followed by the master. This setting may be faulty. If-Oplogsize OplogToo small-OplogsizeOption .) IfOplogNot big enough storage experts differ between the current status and status of slaves, in which case forced re-synchronization itself is unnecessary. When you set autoresync, the slave station will not try to automatically re-sync multiple times once within 10 minutes.

Partition cluster optionsBytes ¶

Configsvr restart ¶

Default Value:False

Set this value to true to configureConfigure DatabaseThe shard N. Bundle, group; N. group, and the cluster consumer d use the default port 27019 of this option to write the dbpath directory of all data files/configdb subdirectories.

Shardsvr ghost ¶

Default Value:False

Set this value to true and configure mongod, for example, fragments of the cluster in a partition. The default port of is 27018.

Nomoveparanoia success ¶

Default Value:False

When set to true, nomoveparanoia disables the "paranoid mode" data block migration operation. Please referBlock migrationAnd movechunk command documentation for more information.

By default, mongod will save on the "paranoid mode" during the migration of data blocks from "servers ". Set this option to disable this paranoia.

Configdb slave ¶

Default Value:None.

Format : <Config1>, <config2><: Port>, <config3>

Set this option to specify the configuration database (that isConfigure Database)Chip Cluster. You have started the investigation analyzer and must specify the configuration server or 3 configuration server, separated by commas.

This setting only affects mongos.

Test Environment ¶

Default Value:False

Mongos instances are not started only when unit tests are run.

This setting only affects mongos processes and only uses internal tests.

Chunksize limit ¶

Default Value:64

The value of this option determines the size of eachBlockLocalChip ClusterDistribution Data. The default value is 64 MB. Large blocks may lead to uneven distribution of data, while small data blocks may lead to frequent and unnecessary migration. However, in some cases, it may be necessary to set different block sizes.

This setting only affects mongos. In addition, during initialization, chunksizeOnlySet the block size to the first cluster. If you modify the runtime option, the new value will not work. See"Modify block size"The process, if you need to change the block size in the existing chip cluster.

Localthreshold restart ¶

In the new version 2.2.

Localthreshold affects Program Logic:MongosOfWhen using, selectReplica setThe Member reads data from the client. Specify the value localthreshold in milliseconds. The default value is 15, which corresponds to the default value of all clients.

This setting only affects mongos.

When mongos receives a requestLevel 2Member of mongos:

  • Find the most recent appropriate setting and the member's ping time.
  • Build a list of replica integrators, which is the most recent and suitable member in 15 ms s

If you specify the value localthreshold, mongos will build the sub-member list within the latency allowed by this value.

  • Mongos selects a member, randomly reading from the list.

 

 

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.