MongoDB Configuration File Templates

The configuration templates include basic recommended settings for MongoDB configuration files for mongod instances, mongos instances (sharded clusters only), and config servers (sharded clusters only) for the initial setup of the Event Repository. Refer to the reference material MongoDB Configuration File Options in your MongoDB product documentation for descriptions of these options and other MongoDB configuration file options.

mongod.conf File

This section shows a mongod instance MongoDB configuration file (mongod.conf) template that includes basic recommended settings for the initial setup of the Event Repository. You can use this template for mongod instances for a non-sharded deployment and for mongod instances of your shard replica sets.

systemLog:
    destination: file
    path: /var/log/mongodb/mongod.log
    logAppend: true

processManagement:
    fork: true
    pidFilePath: /var/run/mongodb/mongod.pid

net:
    bindIp: IP_address,127.0.0.1
    port: 27017

storage:
    dbPath: /var/lib/mongo
    engine: wiredTiger
    wiredTiger:
        engineConfig:
            directoryForIndexes: true
            
security:
    authorization: enabled
    keyFile: /srv/mongodb/mongodb-keyfile

replication:
    replSetName: MtxEventReplSet

#sharding:
#    clusterRole: shardsvr

mongos.conf File (Use for Sharded Clusters Only)

This section shows a mongos instance MongoDB configuration file (mongos.conf) template that includes basic recommended settings for the initial setup of the Event Repository.

systemLog:
    destination: file
    path: /var/log/mongodb/mongos_27017.log
    logAppend: true

processManagement:
    fork: true

net:
    bindIp: hostname or IP,127.0.0.1
    port: 27017

security:
    keyFile: /srv/mongodb/mongodb-keyfile

sharding:
    configDB: MtxConfigReplSet/config server hostnames or IPs

where:

  • hostname or IP is the IP address or hostname.
  • config server hostnames or IP is the configuration server IP addresss or hostnames.

mongod.conf File for Config Servers (User for Sharded Clusters ONLY)

This section shows a config server MongoDB configuration file (mongod.conf) template that includes basic recommended settings for the initial setup of the Event Repository.

systemLog:
    destination: file
    path: /var/log/mongodb/mongod-configsvr.log
    logAppend: true

processManagement:
    fork: true
    pidFilePath: /var/log/mongodb/mongod-configsvr.pid

net:
    bindIp: hostname or IP,127.0.0.1
    port: 27019

storage:
    dbPath: /var/lib/mongo/configsvr/
    engine: wiredTiger

security:
    keyFile: /srv/mongodb/mongodb-keyfile

replication:
    replSetName: MtxConfigReplSet

sharding:
    clusterRole: configsvr

where:

  • hostname or IP is the IP address or hostname.