Cluster Configuration File
Overview
The mongocli
command requires cluster configuration
settings for creating or updating a MongoDB Cloud Manager or MongoDB Ops Manager
cluster. The configuration properties can be provided
through a .yaml
or .json
file. The following sections
describe the Configuration Properties that are required for
creating or updating a cluster and provide a
Sample Configuration File that you can copy and modify.
Configuration Properties
The following sections contain the:
Cluster-wide configuration properties
Replica set member configuration properties
Sharded cluster configuration properties
Cluster-Wide Settings
The configuration file for creating or updating a MongoDB Cloud Manager or MongoDB Ops Manager cluster must contain the following cluster-wide settings:
Field | Type | Description |
---|---|---|
name | string | Name of the cluster. |
version | string | Version of the mongod process to deploy. |
featureCompatibilityVersion | string | Feature Compatibility Version
of the deployment. |
processes | array of objects | Required for replica sets. An array of objects containing
settings for each mongod process. Each mongod has
replica set member settings. |
shards | array of objects | Required for sharded clusters. An array of objects containing
settings for each shard. |
config | object | Required for sharded clusters. Object that contains your
config server
replica set. |
mongos | array of objects | Required for sharded clusters. An array of objects containing
settings for each mongos instance. |
Replica Set Member Settings
The configuration file for creating or updating a MongoDB Cloud Manager or MongoDB Ops Manager cluster can contain the following settings for each replica set member:
Field | Type | Description | Required? | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
auditLogDestination | string | Setting that enables auditing and specifies where to send all audit events. MongoDB CLI accepts the following values:
This setting corresponds to the auditLog.destination configuration file option. | no | ||||||||||
auditLogFilter | string | Setting that filters which events are audited. The filter limits results to match the query you specify. To learn more about creating filters, see Configure Audit Filters. This setting corresponds to the auditLog.filter configuration file option. | no | ||||||||||
auditLogFormat | string | Format of the output file for
auditing if MongoDB CLI accepts the following values:
This setting corresponds to the auditLog.format configuration file option. | no | ||||||||||
auditLogPath | string | Output file for auditing if
This setting corresponds to the auditLog.path configuration file option. | no | ||||||||||
bindIp | string | Hostnames and/or IP addresses and/or full Unix domain socket
paths on which This setting corresponds to the net.bindIp configuration file option. | no | ||||||||||
bindIpAll | boolean | Flag that indicates whether the This setting corresponds to the net.bindIpAll configuration file option. | no | ||||||||||
buildIndexes | boolean | Flag that indicates whether to direct the This setting corresponds to the buildIndexes replica set configuration option. | no | ||||||||||
dbPath | string | Directory where the mongod instance stores its
data. This cannot be modified after deployment. | yes | ||||||||||
delay | int | Number of seconds behind the primary member that this member should lag. This setting corresponds to the slaveDelay replica set configuration option. | no | ||||||||||
directoryPerDB | boolean | Flag that indicates whether MongoDB should use a separate directory to store data
for each database. The directories are under the
By default, This setting corresponds to the | no | ||||||||||
enableMajorityReadConcern | boolean | Flag that indicates whether or not to enable read concern
By default, This setting corresponds to the replication.enableMajorityReadConcern replica set configuration option. | no | ||||||||||
hostname | string | Name of the host to add to the replica set. This is the
host on which Ops Manager deploys the mongod process. | yes | ||||||||||
inMemory.engineConfig.
inMemorySizeGB | float | Maximum amount of memory to allocate for
in-memory storage engine data,
including indexes, oplog if the The value can range from NoteEnterprise FeatureAvailable for MongoDB Enterprise only. This setting corresponds to the
| no | ||||||||||
ipv6 | boolean | Flag that indicates whether the deployment supports IPv6.
MongoDB CLI accepts the following values: This setting corresponds to the net.ipv6 configuration file option. | no | ||||||||||
logDestination | string | Destination to which MongoDB sends all log output. MongoDB CLI
accepts the following values: If you do not specify This setting corresponds to the systemLog.destination configuration file option. | no | ||||||||||
logPath | string | Location and name of the log file for the mongod process on
the host. | yes | ||||||||||
oplogSizeMB | integer | Maximum size in megabytes for the replication oplog. This setting corresponds to the replication.oplogSizeMB replica set configuration option. | no | ||||||||||
port | integer | Port for the replica set member. The mongod process
must have exclusive access to the specified port. | yes | ||||||||||
priority | integer | Priority of the replica set member during elections. Value can be:
Non-voting members must have a priority of | yes | ||||||||||
tls.CAFile | string |
This setting corresponds to the net.tls.CAFile | no | ||||||||||
tls.
certificateKeyFile | string |
This setting corresponds to the net.tls.certificateKeyFile
| no | ||||||||||
tls.
certificateKeyFilePassword | string | Password to de-crypt the certificate-key file. Use the This setting corresponds to the
net.tls.certificateKeyFilePassword
| no | ||||||||||
tls.certificateSelector | string | Certificate property that the MongoDB Agent uses to select a matching certificate from the operating system’s certificate store to use for TLS/SSL. MongoDB CLI accepts one of the following key-value mappings as an
argument of
This setting corresponds to the
net.tls.certificateSelector
| no | ||||||||||
tls.
clusterCertificateSelector | string | Certificate property that the MongoDB Agent uses to select a matching certificate from the operating system’s certificate store to use for internal x.509 membership authentication. MongoDB CLI accepts one of the following key-value mappings as an
argument of
This setting corresponds to the
net.tls.clustercertificateSelector
| no | ||||||||||
tls.clusterFile | string |
This setting corresponds to the net.tls.clusterFile
| no | ||||||||||
tls.clusterPassword | string | The password to de-crypt the x.509 certificate-key file specified
with Use the This setting corresponds to the net.tls.clusterPassword
| no | ||||||||||
tls.CRLFile | string | The This setting corresponds to the net.tls.CRLFile
| no | ||||||||||
tls.disabledProtocols | string | Protocols or versions over which a MongoDB server running with TLS refuses incoming connections. This setting corresponds to the net.tls.disabledProtocols
| no | ||||||||||
tls.FIPSMode | string | Enable or disable the use of the FIPS mode of the TLS library for
the This setting corresponds to the net.tls.FIPSMode
| no | ||||||||||
tls.mode | string | Enables TLS for all network connections. MongoDB CLI accepts the following arguments for this setting:
This setting corresponds to the net.tls.mode
| no | ||||||||||
tls.PEMKeyFile | string |
ImportantThis setting is deprecated. Use This setting corresponds to the net.ssl.PEMKeyFile
| no | ||||||||||
votes | integer | Number that indicates whether the replica set member votes in the election. MongoDB CLI accepts the following values:
To learn more about | yes | ||||||||||
wiredTiger.engineConfig.
cacheSizeGB | float | Maximum size of the internal cache that WiredTiger uses for all data. The value can range from
Avoid increasing the WiredTiger internal cache size above its default value. This setting corresponds to the
| no | ||||||||||
wiredTiger.engineConfig.
journalCompressor | string | no | |||||||||||
wiredTiger.engineConfig.
directoryForIndexes | boolean | Flag that indicates whether By using a symbolic link, you can specify a different location
for the indexes. Specifically, when the By default This setting corresponds to the
| no | ||||||||||
wiredTiger.engineConfig.
maxCacheOverflowFileSizeGB | float | NoteLimited version supportThis setting is only supported for clusters running MongoDB versions:
Maximum size (in GB) for the "lookaside (or cache
overflow) table" file named The setting can accept the following values:
To change the maximum size during runtime, use the
This setting corresponds to the
| no | ||||||||||
wiredTiger.collectionConfig.
blockCompressor | string | Default compression for collection data. You can override this on a per-collection basis when creating collections. Available compressors are: By default the compressor is snappy. This setting affects all newly created collections. If you change the value of this setting on an existing MongoDB deployment, all new collections will use the specified compressor. Existing collections continue to use the compressor that was specified when they were created, or the default compressor at that time. This setting corresponds to the
| no | ||||||||||
wiredTiger.indexConfig.
prefixCompression | boolean | Flag that indicates whether to enable or disable prefix compression for index data. If By default This setting affects all indexes created. If you change the value of this setting on an existing MongoDB deployment, all new indexes will use prefix compression. Existing indexes are not affected. This setting corresponds to the
| no |
Shard Settings
The configuration file for creating or updating a MongoDB Cloud Manager or MongoDB Ops Manager cluster can contain the following settings for each shard:
Field | Type | Description | Required? |
---|---|---|---|
name | string | Name of the of the shard. | yes |
processes | array of objects | An array of objects containing settings for each mongod
process. Each mongod has replica set member settings. | yes |
Sample Configuration File
name: "myCluster" version: 4.2.2 featureCompatibilityVersion: 4.2 processes: - hostname: host0 dbPath: /data/cluster_2/rs1 logPath: /data/cluster_2/rs1/mongodb.log priority: 1 votes: 1 port: 29010 - hostname: host1 dbPath: /data/cluster_2/rs2 logPath: /data/cluster_2/rs2/mongodb.log priority: 1 votes: 1 port: 29020 - hostname: host2 dbPath: /data/cluster_2/rs3 logPath: /data/cluster_2/rs3/mongodb.log priority: 1 votes: 1 port: 29030
{ "name": "myCluster", "version": "4.2.2", "featureCompatibilityVersion": "4.2", "processes": [ { "hostname": "host0", "dbPath": "/data/cluster_3/rs1", "logPath": "/data/cluster_3/rs1/mongodb.log", "priority": 1, "votes": 1, "port": 30010 }, { "hostname": "host1", "dbPath": "/data/cluster_3/rs2", "logPath": "/data/cluster_3/rs2/mongodb.log", "priority": 1, "votes": 1, "port": 30020 }, { "hostname": "host2", "dbPath": "/data/cluster_3/rs3", "logPath": "/data/cluster_3/rs3/mongodb.log", "priority": 1, "votes": 1, "port": 30030 } ] }
{ "name": "myShardedCluster", "version": "4.2.2", "featureCompatibilityVersion": "4.2", "shards": [ { "name": "myShard_0", "processes": [ { "dbPath": "/data/myCluster/myShard_0/27000", "hostname": "host0.example", "logPath": "/data/myCluster/myShard_0/27000/mongodb.log", "port": 27000, "votes": 1 }, { "dbPath": "/data/myCluster/myShard_0/27001", "hostname": "host1.example", "logPath": "/data/myCluster/myShard_0/27001/mongodb.log", "port": 27001, "votes": 1 }, { "dbPath": "/data/myCluster/myShard_0/27002", "hostname": "host2.example", "logPath": "/data/myCluster/myShard_0/27002/mongodb.log", "port": 27002, "version": "4.2.8-ent", "votes": 1 } ] }, { "name": "myShard_1", "processes": [ { "dbPath": "/data/myCluster/myShard_1/28000", "hostname": "host3.example", "logPath": "/data/myCluster/myShard_1/28000/mongodb.log", "port": 28000, "votes": 1 }, { "dbPath": "/data/myCluster/myShard_1/28001", "hostname": "host4.example", "logPath": "/data/myCluster/myShard_1/28001/mongodb.log", "port": 28001, "votes": 1 }, { "dbPath": "/data/myCluster/myShard_1/28002", "hostname": "host5.example", "logPath": "/data/myCluster/myShard_1/28002/mongodb.log", "port": 28002, "votes": 1 } ] } ], "config": { "name": "configRS", "processes": [ { "dbPath": "/data/myCluster/configRS/29000", "hostname": "host6.example", "logPath": "/data/myCluster/configRS/29000/mongodb.log", "port": 29000, "votes": 1 }, { "dbPath": "/data/myCluster/configRS/29001", "hostname": "host7.example", "logPath": "/data/myCluster/configRS/29001/mongodb.log", "port": 29001, "votes": 1 }, { "dbPath": "/data/myCluster/configRS/29002", "hostname": "host8.example", "logPath": "/data/myCluster/configRS/29002/mongodb.log", "port": 29002, "votes": 1 } ] }, "mongos": [ { "hostname": "host9.example", "logPath": "/data/myCluster/mongoses/27015/mongodb.log", "port": 27015 } ] }