- MongoDB Agent >
- MongoDB Agent Settings
MongoDB Agent Settings¶
On this page
This page describes possible settings for the MongoDB Agent. These values are set after first launching Cloud Manager and not through manual editing of these files.
Warning
If you edit authentication or TLS settings through Settings or Deployments in the Cloud Manager interface, those changes overwrite any manual changes in this configuration file.
Configuration File & Settings Locations¶
- Windows
- macOS
- Ubuntu/Debian
- RHEL/CentOS/SLES/AMZ
- Linux
The location of the MongoDB Agent configuration file is
C:\MMSData\Automation\automation-agent.config
.
Note
The MongoDB Agent configuration file is named
automation-agent.config
as a way to enable easier upgrades
for those using legacy agents.
The location of the MongoDB Agent configuration file is
/path/to/install/local.config
.
The location of the MongoDB Agent configuration file is
/etc/mongodb-mms/automation-agent.config
.
Note
The MongoDB Agent configuration file is named
automation-agent.config
as a way to enable easier upgrades
for those using legacy agents.
The location of the MongoDB Agent configuration file is
/etc/mongodb-mms/automation-agent.config
.
Note
The MongoDB Agent configuration file is named
automation-agent.config
as a way to enable easier upgrades
for those using legacy agents.
The location of the MongoDB Agent configuration file is
/path/to/install/local.config
.
You can configure additional Monitoring settings and Backup settings through the Cloud Manager Console.
MongoDB Agent Settings¶
The following settings are required. All other settings are set to default values.
-
mmsGroupId
¶ Type: string
Required.
Specifies the ID of your Cloud Manager project. In Cloud Manager, click Deployments, then Agents and then select the appropriate operating system under Downloads & Settings.
When the Install Agent Instructions box appears, these values can be copied directly from this box by clicking copy icon .
-
mmsApiKey
¶ Type: string
Required.
Specifies the Cloud Manager agent API key of your Cloud Manager project.
You can use an Agent API key that you have already generated for the project. Otherwise, you can generate a new Agent API key. A project can have more than one Agent API key, and any of the project’s agents can use any of the keys. For more information, see Manage Agent API Keys.
To generate an Agent API key, go to the Agent API Keys tab. To navigate to the tab, from the Deployment view, click the Agents tab and then the Agent API Keys tab.
Important
When you generate an Agent API Key, Cloud Manager displays it one time only. You must copy this key. Treat it like a password; store it in a secure place. Cloud Manager never displays the full key again.
Note
To enable the MongoDB Agent to request the Agent API Key from a shell command, set the
mmsApiKeyExec
option in the configuration file rather than setting themmsApiKey
option.
-
mmsGroupId
¶ Type: string
Required.
Specifies the ID of your Cloud Manager project. In Cloud Manager, click Deployments, then Agents and then select the appropriate operating system under Downloads & Settings.
When the Install Agent Instructions box appears, these values can be copied directly from this box by clicking copy icon .
This setting is usually set when the MongoDB Agent is installed and is required to bind the server to a project.
-
mmsApiKey
¶ Type: string
Required.
Specifies the Cloud Manager agent API key of your Cloud Manager project.
You can use an Agent API key that you have already generated for the project. Otherwise, you can generate a new Agent API key. A project can have more than one Agent API key, and any of the project’s agents can use any of the keys. For more information, see Manage Agent API Keys.
To generate an Agent API key, go to the Agent API Keys tab. To navigate to the tab, from the Deployment view, click the Agents tab and then the Agent API Keys tab.
Important
When you generate an Agent API Key, Cloud Manager displays it one time only. You must copy this key. Treat it like a password; store it in a secure place. Cloud Manager never displays the full key again.
This setting is usually set when the MongoDB Agent is installed and is required to bind the server to a project.
Note
You can specify the password from a shell command by using the
mmsApiKeyExec
option instead ofmmsApiKey
.
-
mmsBaseUrl
¶ Type: string
Specifies the URL of the Cloud Manager.
Important
This value is set by default and should not be modified.
Logging Settings¶
-
logFile
¶ Type: string
Specifies the path to which Cloud Manager should write the MongoDB Agent’s log.
The default path depends on your platform. The MongoDB Agent uses the default filename
automation-agent.log
whether or not the deployment uses Automation.Important
Automatic rotation of your MongoDB Agent logs only occurs when an update to the log file is made. To manually rotate your MongoDB Agent logs, see Manually Rotate the MongoDB Agent Logs for more information.
Platform Default Path Linux /var/log/mongodb-mms-automation/automation-agent.log
Windows C:\MMSAutomation\log\mongodb-mms-automation\automation-agent.log
-
logLevel
¶ Type: string
Specifies the level of logging granularity.
Choose from the following severity levels, from most to least amount of information:
DEBUG
INFO
WARN
ERROR
FATAL
By default,
logLevel
isINFO
.Each level includes the log items included in the succeeding levels.
Example
- If you choose
DEBUG
, the MongoDB Agent logs all messages, includingINFO
,WARN
,ERROR
andFATAL
. - If you choose
FATAL
, the MongoDB Agent only logsFATAL
messages.
-
maxLogFiles
¶ Type: integer
Specifies the maximum number of rotated log files to retain.
By default,
maxLogFiles
is10
. You can change the value to retain a different quantity of rotated log files.
-
maxLogFileDurationHrs
¶ Type: float
Specifies the number of hours after which the logs are rotated.
Manually Rotate the MongoDB Agent Logs
On UNIX- and Linux-based systems you can manually rotate the MongoDB Agent logs. Issue a
kill
command with theSIGUSR1
signal for the Agent process:On Windows-based systems, you can manually restart the MongoDB Agent with a Service restart:
- Click the Start menu.
- Search for
services
. - Find the MongoDB Agent.
- Right-click on the Agent and click Restart.
This rotates the MongoDB Agent logs.
-
maxLogFileSize
¶ Type: integer
Specifies the maximum size, in bytes, of a log file before the logs are rotated. If unspecified, the MongoDB Agent does not rotate logs based on file size.
Connection Settings¶
-
dialTimeoutSeconds
¶ Type: integer
Specifies the number of seconds to wait before a connection times out. By default, connections time out after 40 seconds. However, The MongoDB Agent may frequently time out of connections for one or more of the following reasons:
- High network latency
- High server load
- Large TLS keys
- Lack of TLS accelerator
- Insufficient CPU speed
MongoDB recommends gradually increasing the value of the
dialTimeoutSeconds
MongoDB Agent configuration setting to prevent frequent premature connection timeouts.Note
Increasing this value also increases the time required to deploy configuration changes to the MongoDB Agent. Experiment with small, incremental increases until you determine the optimum value for your deployment.
-
serverSelectionTimeoutSeconds
¶ Type: integer
Specifies the number of seconds the MongoDB Agent waits before it stops trying to establish a connection to a MongoDB process. By default, the MongoDB Agent abandons attempts to establish a connection after 10 seconds.
HTTP Proxy Settings¶
-
httpProxy
¶ Type: string
Specifies the URL of an HTTP proxy server the MongoDB Agent can use.
Configuration Backup Settings¶
-
mmsConfigBackup
¶ Type: string
Specifies the path to the Cloud Manager configuration backup file. This file describes the desired state of the deployment.
Cloud Manager TLS Settings¶
Specify the settings that the MongoDB Agent uses when communicating with Cloud Manager using TLS.
-
httpsCAFile
¶ Type: string
Specifies the absolute path that contains the trusted Certificate Authority certificates in
PEM
format. This certificate verifies that the MongoDB Agent is talking to the designated Cloud Manager instance.Note
Add the Certificate Authority for the
downloads.mongodb.com
certificate to this.pem
file if you:- Need your MongoDB Agents to download their MongoDB installers from the Internet,
- Use TLS to encrypt connections, and
- Signed your certificates with a private Certificate Authority. (You set
the
httpsCAFile
option.)
To learn how to download TLS certificates from another web site, see the OpenSSL Cookbook entry.
Important
When Cloud Manager starts, it caches the Certificate Authority you provided. If you change your Certificate Authority certificate, restart Cloud Manager.
-
sslRequireValidMMSServerCertificates
¶ Type: boolean
Important
Deprecated. Use
tlsRequireValidMMSServerCertificates
instead.
-
tlsRequireValidMMSServerCertificates
¶ Type: boolean
Specifies if the MongoDB Agent should validate TLS certificates presented by Cloud Manager.
Warning
Setting this option to
false
disables certificate verification and makes connections between the MongoDB Agent and Cloud Manager susceptible to man-in-the-middle attacks. Setting this option tofalse
is only recommended for testing purposes.
Push Live Migration Settings¶
-
agentFeatureCloudMigrationEnabled
¶ Type: boolean
Optional.
Specifies whether the MongoDB Agent on the migration host is configured to run the Live Migration process from a source Cloud Manager deployment to a target cluster in Atlas.
This option defaults to
false
, which prevents using the MongoDB Agent on this host for Live Migration to Atlas.To enable the Live Migration process, provision a migration host and set
agentFeatureCloudMigrationEnabled
totrue
.
Externally Sourced Configuration Settings¶
-
enableLocalConfigurationServer
¶ Type: boolean
Specifies whether the MongoDB Agent stores MongoDB process configuration files on disk or cached in memory.
This option defaults to
false
, which stores the configuration files on disk. Setting this option totrue
caches the configuration in memory.Warning
Setting this option to
true
impacts the availability of your deployment.When this feature is enabled, the MongoDB Agent doesn’t store the MongoDB process configuration on disk. If the Cloud Manager app server is unavailable and the MongoDB Agent attempts to restart, then the MongoDB Agent stops running because it doesn’t have the necessary configuration information. If a MongoDB process crashes while the MongoDB Agent isn’t running, then the MongoDB Agent can’t restart the process.
-
keepUnusedMongodbVersions
¶ Type: boolean
Flag that indicates whether the MongoDB Agent retains unused MongoDB version binaries that it downloads. By default,
keepUnusedMongodbVersions
is false.
-
localConfigurationServerPort
¶ Type: integer
Specifies the port to serve the MongoDB process configuration to when using the local configuration server. To set this option,
enableLocalConfigurationServer
must betrue
.If unspecified, the MongoDB Agent chooses an available port automatically.
-
mmsApiKeyExec
¶ Type: string
Specifies a shell command to call the Cloud Manager agent API key of your Cloud Manager project.
Automation Settings¶
The following configuration settings are used for authentication in automated clusters.
MongoDB Kerberos Settings¶
Specify these settings if Automation authenticates to hosts using Kerberos. To configure Kerberos, see Configure the MongoDB Agent for Kerberos.
-
krb5ConfigLocation
¶ Type: string
Specifies an absolute path to an non-system-standard location for the Kerberos configuration file.
Note
Cloud Manager creates a Kerberos Credential (Ticket) Cache for each agent automatically when Kerberos is enabled. If you want to override the location of the Kerberos Credential Cache, you must set the
KRB5CCNAME
environment variable to the desired file name and path before running the agent.
-
backupAgentKrb5CCName
¶ Type string
Specifies the
KRB5CC
environment variable that the MongoDB Agent sets for the Backup process. Used only to authenticate the Backup to your MongoDB deployment when the MongoDB Agent starts the Backup function.
-
monitoringAgentKrb5CCName
¶ Type string
Specifies the
KRB5CC
environment variable that the MongoDB Agent sets for the Monitoring function. Used only to authenticate Monitoring to your MongoDB deployment when the MongoDB Agent starts the Monitoring function.
Monitoring Settings¶
Use the Cloud Manager interface to configure Monitoring settings.
Log Settings¶
In the navigation, click Deployment.
Click the Agents tab.
Click Downloads & Settings.
In the Agent Log Settings section, click next to Monitoring Log Settings.
Edit the Monitoring log settings:
Setting Default Value Console Suggested Value Linux Log File Path /var/log/mongodb-mms-automation/monitoring-agent.log
Windows Log File Path %SystemDrive%\MMSAutomation\log\mongodb-mms-automation\monitoring-agent.log
Rotate Logs YES Size Threshold (MB) 1000 Time Threshold (Hours) 24 Max Uncompressed Files 5 Max Percent of Disk 2 Total Number of Log Files 0 Click Save.
Custom Settings¶
- In the navigation, click Deployment.
- Click the Agents tab.
- Click Downloads & Settings.
- In the Custom Configuration section, next to Edit Custom Configurations, click .
- Enter the Monitoring configuration setting and value.
- Click Save and Close.
You can configure the following Monitoring settings:
Connection Settings¶
-
mmsGroupId
¶ Type: string
Specifies the ID of your Cloud Manager project. Find the project ID on the Project Settings page (Settings > Project Settings).
-
mmsApiKey
¶ Type: string
Specifies the Cloud Manager agent API key of your Cloud Manager project.
You can use an Agent API key that you have already generated for the project. Otherwise, you can generate a new Agent API key. A project can have more than one Agent API key, and any of the project’s agents can use any of the keys. For more information, see Manage Agent API Keys.
To generate an Agent API key, go to the Agent API Keys tab. To navigate to the tab, from the Deployment view, click the Agents tab and then the Agent API Keys tab.
Important
When you generate an Agent API Key, Cloud Manager displays it one time only. You must copy this key. Treat it like a password; store it in a secure place. Cloud Manager never displays the full key again.
Cloud Manager configures this setting when you install the MongoDB Agent. If you need to configure Monitoring separately, include this setting.
-
mmsBaseUrl
¶ Type: string
Specifies the URL of the Cloud Manager.
HTTP Proxy Settings¶
-
httpProxy
¶ Type: string
Specifies the URL of an HTTP proxy server that Monitoring can use.
MongoDB Kerberos Settings¶
Specify these settings if Monitoring authenticates to hosts using Kerberos.
To configure Kerberos, see Configure the MongoDB Agent for Kerberos. The same procedures and requirements apply, only use a different UPN for Monitoring.
Note
Cloud Manager creates a Kerberos Credential (Ticket) Cache for each agent
automatically when Kerberos is enabled. If you want to override the
location of the
Kerberos Credential Cache,
you must set the KRB5CCNAME
environment variable to the desired
file name and path before running the agent.
-
krb5Principal
¶ Type: string
Specifies the Kerberos principal that Monitoring uses.
-
krb5Keytab
¶ Type: string
Specifies the absolute path to Kerberos principal’s
keytab
file.
-
krb5ConfigLocation
¶ Type: string
Specifies the absolute path to an non-system-standard location for the Kerberos configuration file.
-
gssapiServiceName
¶ Type: string
Specifies the service name with the
gssapiServiceName
setting.By default, MongoDB uses
mongodb
as its service name.
MongoDB TLS Settings¶
Specify these settings when Monitoring connects to MongoDB deployments using TLS.
To learn more, see Configure MongoDB Agent to Use TLS.
-
useSslForAllConnections
¶ Type: boolean
Specifies whether or not to encrypt all connections to MongoDB deployments using TLS.
Caution
Setting this to
true
overrides any per-host TLS settings configured in the Cloud Manager interface.
-
sslClientCertificate
¶ Type: string
Specifies the absolute path to the private key, client certificate, and optional intermediate certificates in PEM format. Monitoring uses the client certificate to connect to any configured MongoDB deployment that uses TLS and requires client certificates. (The deployment runs with the –tlsCAFile setting.)
Example
If you want to connect to a MongoDB deployment that uses both TLS and certificate validation using
mongosh
:You must set these settings in your Custom Settings:
-
sslClientCertificatePassword
¶ Type: string
Specifies the password needed to decrypt the private key in the
sslClientCertificate
file. Include this setting if you encrypted the client certificate PEM file.
-
sslTrustedServerCertificates
¶ Type: string
Specifies the absolute path that contains the trusted Certificate Authority certificates in PEM format. These certificates verify the server certificate returned from any MongoDB deployments running with TLS.
-
sslRequireValidServerCertificates
¶ Type: boolean
Specifies whether Monitoring should validate the TLS certificates presented by the MongoDB databases.
By default, Cloud Manager sets
sslRequireValidServerCertificates
totrue
. You need a valid trusted certificate to connect to MongoDB instances using TLS.- If MongoDB Agent manages Monitoring, you can’t set this option to
false
. - If you configure Monitoring manually, you can set
sslRequireValidServerCertificates
tofalse
. - If you set
sslRequireValidServerCertificates
tofalse
, don’t setsslTrustedServerCertificates
. Cloud Manager won’t verify the certificates.
Warning
Changing this setting to
false
disables certificate verification and makes connections between Monitoring and MongoDB deployments susceptible to man-in-the-middle attacks. Change this setting tofalse
only for testing purposes.- If MongoDB Agent manages Monitoring, you can’t set this option to
Cloud Manager Server TLS Settings¶
Specify the settings Monitoring uses when communicating with Cloud Manager using TLS.
-
httpsCAFile
¶ Type: string
Specifies the absolute path that contains the trusted Certificate Authority certificates in PEM format. Monitoring uses this certificate to verify that the agent can communicate with the designated Cloud Manager instance.
By default, Monitoring uses the trusted root Certificate Authoritys installed on the host.
If the agent cannot find the trusted root Certificate Authoritys, configure these settings manually.
Backup Settings¶
Use the Cloud Manager interface to configure Backup settings.
Log Settings¶
In the navigation, click Deployment.
Click the Agents tab.
Click Downloads & Settings.
In the Agent Log Settings section, click next to: guilabel:Backup Log Settings.
Edit the Backup log settings:
Setting Default Value Console Suggested Value Linux Log File Path /var/log/mongodb-mms-automation/backup-agent.log
Windows Log File Path %SystemDrive%\MMSAutomation\log\mongodb-mms-automation\backup-agent.log
Rotate Logs YES Size Threshold (MB) 1000 Time Threshold (Hours) 24 Max Uncompressed Files 5 Max Percent of Disk 2 Total Number of Log Files 0 Click Save.
Custom Settings¶
- In the navigation, click Deployment.
- Click the Agents tab.
- Click Downloads & Settings.
- In the Custom Configuration section, next to Edit Custom Configurations, click .
- Enter a Backup configuration setting and value.
- Click Save and Close.
You can configure the following Backup settings:
Connection Settings¶
-
mmsGroupId
¶ Type: string
Specifies the ID of your Cloud Manager project. Find the project ID on the Project Settings page (Settings > Project Settings).
-
mmsApiKey
¶ Type: string
Specifies the MongoDB Agent API key of your Cloud Manager project.
You can use an Agent API key that you have already generated for the project. Otherwise, you can generate a new Agent API key. A project can have more than one Agent API key, and any of the project’s agents can use any of the keys. For more information, see Manage Agent API Keys.
To generate an Agent API key, go to the Agent API Keys tab. To navigate to the tab, from the Deployment view, click the Agents tab and then the Agent API Keys tab.
Important
When you generate an Agent API Key, Cloud Manager displays it one time only. You must copy this key. Treat it like a password; store it in a secure place. Cloud Manager never displays the full key again.
Cloud Manager configures this setting when you install the MongoDB Agent. If you need to configure Backup separately, include this setting.
-
mothership
¶ Type: string
Specifies the hostname and port of the Cloud Manager.
Note
Don’t include the protocol (
http://
orhttps://
) in themothership
setting.
-
mothershipResponseHeaderTimeout
¶ Type: integer
Specifies the length of time in seconds Backup waits for the Cloud Manager to respond. If the MongoDB Agent doesn’t get a response, it resets and retries the connection to the Cloud Manager. This value defaults to
90
seconds.
-
https
¶ Type: boolean
Specifies whether or not communication with the Cloud Manager web server uses Secure HTTP.
HTTP Proxy Settings¶
-
httpProxy
¶ Type: string
Specifies the URL of an HTTP proxy that Backup can use.
MongoDB Kerberos Settings¶
To configure Kerberos, see Configure the MongoDB Agent for Kerberos. The same procedures and requirements apply, only use a different UPN for Backup.
Note
Cloud Manager creates a Kerberos Credential (Ticket) Cache for each agent
automatically when Kerberos is enabled. If you want to override the
location of the
Kerberos Credential Cache,
you must set the KRB5CCNAME
environment variable to the desired
file name and path before running the agent.
-
krb5Principal
¶ Type: string
Specifies the Kerberos principal that Backup uses.
-
krb5Keytab
¶ Type: string
Specifies the absolute path to Kerberos principal’s keytab file.
-
krb5ConfigLocation
¶ Type: string
Specifies the absolute path to an non-system-standard location for the Kerberos configuration file.
-
gsappiServiceName
¶ Type: string
Specifies the service name with the
gssapiServiceName
setting.By default, MongoDB uses
mongodb
as its service name.
MongoDB TLS Settings¶
Specify these settings when Backup connects to MongoDB deployments using TLS.
To learn more, see Configure MongoDB Agent to Use TLS.
-
sslClientCertificate
¶ Type: string
Specifies the path to the private key, client certificate, and optional intermediate certificates in PEM format. Backup uses the client certificate when connecting to a MongoDB deployment that uses TLS and requires client certificates. (The deployment runs with the –tlsCAFile setting.)
-
sslClientCertificatePassword
¶ Type: string
Specifies the password needed to decrypt the private key in the
sslClientCertificate
file. Include this setting if you encrypted the client certificate PEM file.
-
sslTrustedServerCertificates
¶ Type: string
Specifies the path that contains the trusted CA certificates in PEM format. These certificates verify the server certificate returned from any MongoDB deployments running with TLS.
-
sslRequireValidServerCertificates
¶ Type: boolean
Specifies if Backup should validate TLS certificates presented by the MongoDB deployments.
Warning
Changing this setting to
false
disables certificate verification and makes connections between Backup and MongoDB deployments susceptible to man-in-the-middle attacks. Change this setting tofalse
only for testing purposes.
Cloud Manager Server TLS Settings¶
Specify the settings Backup use when communicating with Cloud Manager using TLS.
-
sslTrustedMMSBackupServerCertificate
¶ Specifies the absolute path that contains the trusted Certificate Authority certificates in PEM format. Backup uses this certificate to verify that the MongoDB Agent can communicate with the designated Cloud Manager instance.
By default, Backup uses the trusted root Certificate Authoritys installed on the system.
If Backup cannot find the trusted root Certificate Authoritys, configure these settings manually.
If Cloud Manager use a self-signed TLS certificate, provide a value for this setting.