Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Install or Update the Backup Agent from an Archive

Overview

The Backup Agent polls the primary MongoDB instance of every backup-enabled replica set and transmits the operations to the Ops Manager service.

The Backup Agent relies on the Ops Manager Monitoring Agent to populate the list of sharded clusters and replica sets eligible for backup. If the appropriate hosts are not added, or the Monitoring Agent is not being correctly run, the lists may be incomplete or out-of-date. If you have not already installed and configured the Monitoring Agent, please refer to the Install Monitoring Agent documentation.

Considerations

MongoDB Requirements

Ops Manager only supports backing up replica sets and sharded clusters, and does not support backing up standalone instances.

Ops Manager only supports backup for replica sets that run MongoDB 2.0 or later.

Ops Manager only supports backup for sharded clusters that run MongoDB 2.4.3 or later.

All backed up replica sets and config servers must be able to maintain oplog entries, by default, for at least 3 hours over the last 24 hour period. You can change the default window by adding the mms.backup.minimumOplogWindowHours setting to the Custom tab on the Ops Manager Configuration page.

Agent Architecture

To avoid resource contention, run the agent on a host other than the hosts where the MongoDB instances are running. Be sure the agent can access the MongoDB hosts.

Running on Amazon EC2

If you run the Backup Agent on Amazon EC2, do not use the t1.micro instance type, which has a CPU scheduling policy that does not typically provide sufficient capacity to support a Backup Agent for a production deployment. Use a larger instance type instead.

Prerequisites

Monitoring Agent

Install and configure the Monitoring Agent, as described in the Monitoring Agent documentation.

Firewall

If your MongoDB instances operate within a firewall, configure your network infrastructure to allow outbound connections on port 443 (SSL) to api-backup.mongodb.com.

Access Control

If you use the Backup feature with a MongoDB deployment that uses authentication, before installing the Backup Agent, you must create a user in MongoDB with the appropriate access. See Configure Backup Agent for Access Control.

Backup Directory

After you install the Backup Agent, do not use the agent’s directory location for anything other than the agent itself. The Backup Agent periodically deletes the contents of its root directory.

Procedures

This section includes procedures for installing and updating the Backup Agent on a Linux system not listed in the Agent Downloads list on the Agents page in the Settings tab.

Install the Backup Agent from a tar.gz Archive

1

Download the latest version of the Backup Agent archive.

On a system shell, issue a command that resembles the following. Replace linux_x86_64 with your platform, as needed: depending on your operating system:

curl -OL <mmsUri>/download/agent/backup/mongodb-mms-backup-agent-latest.linux_x86_64.tar.gz
2

Install the Backup Agent.

To install the agent, extract the archive using a command that resembles the following. Replace linux_x86_64 with your platform, as needed:

tar -xf mongodb-mms-backup-agent-latest.linux_x86_64.tar.gz

The Backup Agent is installed.

3

Retrieve the Ops Manager API key for your Ops Manager group.

In the Settings tab on the Agents page, select your the approriate link for the Backup agent and your operating system. Ops Manager will then display a procedure that includes a step to set your Ops Manager API key. The step displays the actual Ops Manager API key used by your Ops Manager group. Copy the key.

4

Edit the local.config file to include your Ops Manager API key.

In the directory where you installed the Backup Agent, locate and open the local.config file. Enter your API key as the value for the mmsApiKey setting.

5

Optional: Configure the Backup Agent to use a proxy server.

To configure the agent to connect to Ops Manager via a proxy server, you must specify the server in the httpProxy environment variable. In the <install-directory>/local.config file, set the httpProxy value to the URL of to your proxy server:

httpProxy="http://proxy.example.com:9000"
6

Start the Backup Agent.

Issue the following command:

nohup ./mongodb-mms-backup-agent >> backup-agent.log 2>&1 &

Update the Backup Agent from a tar.gz Archive

1

Stop any currently running Backup Agents.

Issue the following command with the system shell:

pkill -f mongodb-mms-backup-agent
2

Download the latest version of the Backup Agent archive.

On a system shell, issue a command that resembles the following. Replace linux_x86_64 with your platform, as needed: depending on your operating system:

curl -OL <mmsUri>/download/agent/backup/mongodb-mms-backup-agent-latest.linux_x86_64.tar.gz
3

Install the Backup Agent.

To install the agent, extract the archive using a command that resembles the following. Replace linux_x86_64 with your platform, as needed:

tar -xf mongodb-mms-backup-agent-latest.linux_x86_64.tar.gz

The Backup Agent is installed.

4

Retrieve the Ops Manager API key for your Ops Manager group.

In the Settings tab on the Agents page, select your the approriate link for the Backup agent and your operating system. Ops Manager will then display a procedure that includes a step to set your Ops Manager API key. The step displays the actual Ops Manager API key used by your Ops Manager group. Copy the key.

5

Edit the local.config file to include your Ops Manager API key.

In the directory where you installed the Backup Agent, locate and open the local.config file. Enter your API key as the value for the mmsApiKey setting.

6

Optional: Configure the Backup Agent to use a proxy server.

To configure the agent to connect to Ops Manager via a proxy server, you must specify the server in the httpProxy environment variable. In the <install-directory>/local.config file, set the httpProxy value to the URL of to your proxy server:

httpProxy="http://proxy.example.com:9000"
7

Start the Backup Agent.

Issue the following command:

nohup ./mongodb-mms-backup-agent >> backup-agent.log 2>&1 &

Next Steps

After you have successfully installed the Backup Agent, see Back up a Deployment to enable backup for a replica set.

Additional Information

If you installed the Backup Agent from the tar.gz archives, see Rotate Agent Log Files to configure log rotation.

The README included with the downloaded package also provides information about the Backup Agent.

For details about backup operations, see Backup FAQs.