- User Guide >
- Monitoring Agent >
- Install Monitoring Agent >
- Install or Update the Monitoring Agent from Archive
Install or Update the Monitoring Agent from Archive¶
On this page
Overview¶
The MMS Monitoring Agent is a lightweight component that runs within your infrastructure, connects to your MongoDB processes, collects data about the state of your deployment, and then sends the data to the On Prem MMS Monitoring service which processes and renders this data. The agent initiates all connections to the On Prem MMS Monitoring service, and communications between the agent and the On Prem MMS Monitoring service are encrypted. A single agent can collect data from multiple MongoDB processes.
Consider the following diagram of an example deployment:
This tutorial will guide you through the steps necessary to install or update On Prem MMS Monitoring on your system. You must install the On Prem Monitoring server itself before installing the Monitoring Agent.
See Monitoring FAQs for additional information.
Considerations¶
Connectivity¶
You must configure the networking rules of your deployment so that:
- the Monitoring Agent can connect to all mongod and mongos instances that you want to monitor.
- the Monitoring Agent can connect to On Prem MMS Monitoring server on port 443
(i.e.
https
.)
The On Prem MMS Monitoring server does not make any outbound connections to the agents or to MongoDB instances. If Exposed DB Host Check is enabled, the On Prem MMS Monitoring server will attempt to connect to your servers occasionally as part of a vulnerability check.
Ensure all mongod and mongos instances are not accessible to hosts outside your deployment.
Monitoring Agent Redundancy¶
A single Monitoring Agent is sufficient and strongly recommended. However, you can run additional instances of the agent as hot standbys to provide redundancy. If the primary agent fails, a standby agent starts monitoring.
When you run multiple agents, only one Monitoring Agent per group or environment is the primary agent. The primary agent reports the cluster’s status to MMS. The remaining agents are completely idle, except to log their status as standby agents and to periodically ask MMS whether they should become the primary.
To install additional agents, simply repeat the installation process.
Collection Interval¶
If you are updating the agent, keep in mind that when the Monitoring Agent restarts, there is a five-minute delay before that agent begins collecting data and sending pings to On Prem MMS Monitoring. If you have multiple agents, this delay permits other agents in your infrastructure to become the primary agent and permits On Prem MMS Monitoring to determine which agent will be primary.
During this interval, the restarted Monitoring Agent will not collect data.
Prerequisites¶
If your MongoDB deployment enforces access control, you must create a user in MongoDB with the appropriate access. See Configure Monitoring Agent for Access Control.
Procedures¶
This section includes procedures for both installing and updating the Monitoring Agent.
Install the Monitoring Agent from a tar.gz
Archive¶
Use this procedure to install the agent on Linux systems:
Download the latest version of the Monitoring Agent archive.¶
With a system shell, issue the following command:
Install the Monitoring Agent.¶
To install the agent, extract the archive by issue the following command:
The Monitoring Agent is installed.
Retrieve the MMS API key for your MMS group.¶
In the Administration tab on the Agents page, click the link for your operating system. MMS will then display a procedure that includes a step to set your MMS API key. The step displays the actual MMS API key used by your MMS group. Copy the key.
Edit the monitoring-agent.config
file to include your MMS API key.¶
In the <install-directory>/monitoring-agent.config
file, set the
mmsApiKey
property to your API key.
Optional: Configure the agent to use a proxy server.¶
If the agent will connect to MMS via a proxy server, you must specify
the server in the http_proxy
environment variable. To specify the
server, use the export
command, as in the following example:
To connect through a proxy, you must install the agent from a
.tar.gz
file, not from a .deb
or .rpm
file.
Start the Monitoring Agent.¶
Issue the following command:
Remember, that you only need to run 1 Monitoring Agent for each MMS group. A single Monitoring Agent can collect data from many MongoDB instances.
Update the Monitoring Agent from a tar.gz
Archive¶
Use this procedure to update the agent on Linux systems:
Stop any currently running Monitoring Agents.¶
Issue the following command:
Download the latest version of the Monitoring Agent archive.¶
With a system shell, issue the following command:
Install the Monitoring Agent.¶
To install the agent, extract the archive by issue the following command:
The Monitoring Agent is installed.
Retrieve the MMS API key for your MMS group.¶
In the Administration tab on the Agents page, click the link for your operating system. MMS will then display a procedure that includes a step to set your MMS API key. The step displays the actual MMS API key used by your MMS group. Copy the key.
Edit the monitoring-agent.config
file to include your MMS API key.¶
In the <install-directory>/monitoring-agent.config
file, set the
mmsApiKey
property to your API key.
Start the Monitoring Agent.¶
Issue the following command:
Remember, that you only need to run 1 Monitoring Agent for each MMS group. A single Monitoring Agent can collect data from many MongoDB instances.
Additional Information¶
If you installed the Monitoring Agent from the tar.gz
archives, see
Rotate Agent Log Files to configure log rotation.