mongodb3.2 configuration file Yaml format detailed

Source: Internet
Author: User

After the mongodb3.x version is the configuration file to YAML syntax format, the following is the YAML configuration file format:
Official Yaml Profile Options reference: https://docs.mongodb.org/manual/... #configuration-file
Only use spaces, not support Tab key, remember, the reason you understand ...

<ignore_js_op>

1
2
3
4
5
6
Systemlog:
DESTINATION:FILE//Specifies that it is a file
Path:/data/logs/mongod.log//Log storage location
logappend:true//generated log content appended to file
# quiet:true//will limit output information in quite mode
# TIMESTAMPFORMAT:ISO8601-UTC//default is iso8601-local, there are other timestamp formats in the log information: ctime,iso8601-utc,iso8601-local



1
2
3
4
5
6
7
8
9
10
Processmanagement:
fork:true//running MongoDB as a daemon, creating a server process
Pidfilepath: "/data/mongo-data/mongod.pid"//pid file path
Net
# bindip:192.168.33.131//Bind IP address to access MongoDB, multiple IP comma separated
port:27017//Port
maxincomingconnections:10000//The default 65535,mongodb instance accepts the maximum number of connections, which is not valid if it is higher than the maximum number of threads accepted by the operating system.
# http:
# enabled:true//http Port Best Off
#RESTInterfaceEnabled: false//Even if the HTTP interface option is turned off, there will be more unsafe factors if this option is turned on



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21st
Storage
DbPath: "/data/mongo-data"//Data File storage path
engine:wiredtiger//Data Engine
Wiredtiger:
ENGINECONFIG://WT engine Configuration
cachesizegb:1//look at the server situation to set up
directoryforindexes:true//whether the index is stored separately by database name
Collectionconfig:
blockcompressor:zlib//compression Configuration
Indexconfig:
prefixcompression:true//Index Configuration
Journal
enabled:true//records the operation log to prevent data loss.
DIRECTORYPERDB:TRUE//specifies that each database file is stored to a separate data directory. If you use this option in an existing system, you need to move the existing data file to the directory beforehand.
Operationprofiling:
SLOWOPTHRESHOLDMS:100//Specifies the slow query time, in milliseconds, if the function is turned on, the data is written to the System.profile collection
Mode: "Slowop"//off, Slowop, all, respectively, corresponding to close, open only slow query, record all operations.
Security
KeyFile: "/data/mongodb-keyfile"//Key file storage location for authentication between the specified shard set or replica set member
Clusterauthmode: "KeyFile"//cluster authentication mode, default is KeyFile
Authorization: "Disabled"//access to database and user role authentication for operations




Replication set-related configuration, according to the above configuration file for the following configuration.

1
2
3
4
Replication
oplogsizemb:50//defaults to 5% of the disk, specifying the maximum size of the oplog. For databases that have already established oplog.rs, specify an invalid
Replsetname: "RS_ZXL"//Specifies the name of the replica set
Secondaryindexprefetch: "All"//Specifies whether the replica set member will load the index into memory before accepting oplog. By default, all indexes are loaded into memory. none load; all loads all; _id_only loads only _id




Shard cluster configuration, shard replica set configuration (on a single-instance node basis)

1
2
3
4
5
Replication
Oplogsizemb:50
Replsetname: "RS_ZXL"
Sharding:
Clusterrole:shardsvr




Config server configuration (on a single-instance node basis)

1
2
Sharding:
Clusterrole:configsvr




MONGOs configuration, (different from single instance)

1
2
3
4
5
6
7
8
Systemlog:
Destination:file
Path:/data/logs/mongos.log
Logappend:true
Net
port:27019
Sharding:
configdb:192.168.33.131:30000

mongodb3.2 configuration file Yaml format detailed

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.