Navigation

Install or Update the Backup Agent with deb Packages

Important

This page describes how to install the agent manually. The easier way to install and run the Backup Agent is through Automation, as described in Install or Update the Backup Agent through Automation.

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 or Update the 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 or sharded clusters that run MongoDB 2.6 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.

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.

Prerequisites

Monitoring Agent

Your deployment must have a running Monitoring Agent. To install the Monitoring Agent, see Monitoring Agent.

Backup Agent Host

Run the Backup Agent on a host that:

  • Is separate from your MongoDB instances. This avoids system resource contention.
  • Can connect to your MongoDB instances. Check network settings for connections between the agent and MongoDB hosts. For a list of needed ports, see open ports for agents.
  • Has at least 2 CPU cores and 3 GB of RAM above platform requirements. With each backup job it runs, the Backup Agent further impacts host performance.

Firewall

If your MongoDB instances operate within a firewall, configure your network infrastructure to allow outbound connections from the Backup Agent to Ops Manager on port 8080 if it is using HTTP or 8443 if it is using HTTPS.

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.

Install the Backup Agent with a deb Package

This procedure installs the Backup Agent on Ubuntu with deb packages. For Debian systems, use the Install or Update the Backup Agent from an Archive procedure.

You can also access install instructions in Ops Manager, including commands you can copy and paste: click Deployment, then Agents, then Downloads & Settings.

1

Login to Ops Manager.

2

Click Deployment, then Agents, and then Downloads & Settings.

3

Select Ubuntu<version> - DEB.

4

Download the latest version of the Backup Agent package.

On a system shell, issue a curl command to download the deb for the agent that works on your platform:

Note

Replace <OpsManagerHost:Port> with the hostname and port of your Ops Manager installation.

For Ubuntu 15.X, 16.X on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 12.X, 14.X on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_amd64.deb
5

Install the Backup Agent package.

To install the agent that works on your platform, issue the appropriate command to install the package:

For Ubuntu 15.X, 16.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 12.X, 14.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.deb

For Ubuntu 12.X, 14.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.deb
6

Generate an agent API key or retrieve an existing agent API key for your Ops Manager project.

  1. Click + Generate Key.

    Note

    The button appears only if the current user is the project owner and the project either has no Agent API keys or just the Original Group API key. An Original Group API key exists only in projects created prior to the new Agent API Key model. The new model allows a project to have more than one key and permits any of the project’s agents to use any of the keys. For more information, see Manage Agent API Keys. If you do not see the + Generate Key button and do not remember your existing agent api key, you can generate a key on the Agent API Keys tab. To navigate to the tab, select Deployment view, then click the Agents tab and then the Agent API Keys tab.

  2. Enter your password and click Verify.

  3. Click + Generate Key again.

Important

When you generate an Agent API key, Ops Manager displays it one time only. You must copy it and store it in a secure place. Ops Manager will never display the full key again.

7

Configure the backup-agent.config file with the Project ID, agent API key, and Backup Server URL.

Edit the /etc/mongodb-mms/backup-agent.config file.

For mmsGroupId, enter your ProjectID.

For mmsApiKey, enter the agent API key.

For mothership, enter the Backup Server URL displayed in the modal.

8

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 /etc/mongodb-mms/backup-agent.config file, set the httpProxy value to the URL of to your proxy server:

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

Start the Backup Agent.

Issue the following command:

For Ubuntu 15.X or later:

sudo systemctl start mongodb-mms-backup-agent.service

For Ubuntu 12.X, 14.X on x64 architecture:

sudo start mongodb-mms-backup-agent

Update the Backup Agent with a deb Package

This procedure updates the Backup Agent on Ubuntu with deb packages. For Debian systems, use the Install or Update the Backup Agent from an Archive procedure.

You can also access update instructions in Ops Manager, including commands you can copy and paste: click Deployment, then Agents, then Downloads & Settings.

1

Login to the host where the Backup Agent is installed.

2

Stop any currently running Backup Agents.

Issue the following command with the system shell:

pkill -f mongodb-mms-backup-agent
3

Login to Ops Manager.

4

Click Deployment, then Agents, and then Downloads & Settings.

5

Select Ubuntu<version> - DEB.

6

Download the latest version of the Backup Agent package.

On a system shell, issue a curl command to download the deb for the agent that works on your platform:

Note

Replace <OpsManagerHost:Port> with the hostname and port of your Ops Manager installation.

For Ubuntu 15.X, 16.X on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 12.X, 14.X on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/backup/mongodb-mms-backup-agent_latest_amd64.deb
7

If your current Backup Agent has a version number earlier that 2.0, purge the existing agent.

Perform this step only if your current agent’s version is earlier than 2.0. To purge the existing Backup Agent, issue the following command:

sudo dpkg -P mongodb-mms-backup-agent
8

Install the Backup Agent package.

To install the agent that works on your platform, issue the appropriate command to install the package:

For Ubuntu 15.X, 16.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 12.X, 14.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.deb

For Ubuntu 12.X, 14.X on x64 architecture:

sudo dpkg -i mongodb-mms-backup-agent_latest_amd64.deb
9

Start the Backup Agent.

Issue the following command:

For Ubuntu 15.X or later:

sudo systemctl start mongodb-mms-backup-agent.service

For Ubuntu 12.X, 14.X on x64 architecture:

sudo start mongodb-mms-backup-agent

Next Steps

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

Additional Information

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

For details about backup operations, see Backup FAQs.