Navigation

Install or Update the Backup Agent on Windows

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 Cloud Manager service.

The Backup Agent relies on the Cloud 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

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

Cloud 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 should maintain oplog entries for at least 1 hour over the last 24 hour period.

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.

Firewall

If your MongoDB instances operate within a firewall, configure your network infrastructure to allow outbound connections from the Backup Agent on port 443 (HTTPS) 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.

Install the Backup Agent On Windows

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

1

Download and run the latest version of the Backup Agent installation binary.

To download the installation binary, use the following URL:

https://cloud.mongodb.com/download/agent/backup/mongodb-mms-backup-agent-latest.windows_x86_64.msi

During installation, the installer prompts you to specify the folder for storing configuration and log files. It is strongly advised that you encrypt or restrict access to this folder.

2

Generate an agent API key or retrieve an existing agent API key for your Cloud Manager group.

  1. Click + Generate Key.

Note

The button appears only if the current user is the group owner and the group either has no Agent API keys or just the Original Group API key. An Original Group API key exists only in groups created prior to the new Agent API Key model. The new model allows a group to have more than one key and permits any of the group’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.

  1. Enter your password and click Verify.
  2. Click + Generate Key again.

Important

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

3

Edit the local.config file to include your Group ID and agent API key.

In the directory where you installed the Backup Agent, locate and open the local.config file.

For mmsGroupId, enter your Group ID as the value. For mmsApiKey, enter the group’s agent API key.

4

Edit the local.config file to include the hostname of the Backup server.

In the Backup Agent installation directory, open the local.config file and set the mothership property to hostname of the Backup server.

5

Start the Backup Agent.

In Windows Control Panel, open Administrative Tools, and then open Services.

In the list of services, select the MongoDB Backup Agent service. Select the Action menu and select Start.

Update the Backup Agent On Windows

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

1

Stop all currently running Backup Agents.

In Windows Control Panel, open Administrative Tools and then Services. In the list of services, select MongoDB Backup Agent. Select the Action menu and select Stop.

If you receive a message that your Backup Agent is out of date, make sure you are running an upgradeable version of the Backup Agent. If you are running the version of the Backup Agent named MongoDBBackup, you must remove it before upgrading. To check if you are running MongoDBBackup, issue the following command in an Administrative command prompt:

sc query MongoDBBackup

If the command returns a result, you must remove the MongoDBBackup agent. To remove it, issue the following:

sc delete MongoDBBackup
2

Download and run the latest version of the Backup Agent installation binary.

To download the installation binary, use the following URL:

https://cloud.mongodb.com/download/agent/backup/mongodb-mms-backup-agent-latest.windows_x86_64.msi

During installation, the installer prompts you to specify the folder for storing configuration and log files. It is strongly advised that you encrypt or restrict access to this folder.

3

Generate an agent API key or retrieve an existing agent API key for your Cloud Manager group.

  1. Click + Generate Key.

Note

The button appears only if the current user is the group owner and the group either has no Agent API keys or just the Original Group API key. An Original Group API key exists only in groups created prior to the new Agent API Key model. The new model allows a group to have more than one key and permits any of the group’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.

  1. Enter your password and click Verify.
  2. Click + Generate Key again.

Important

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

4

Edit the local.config file to include your Group ID and agent API key.

In the directory where you installed the Backup Agent, locate and open the local.config file.

For mmsGroupId, enter your Group ID as the value. For mmsApiKey, enter the group’s agent API key.

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.