Navigation

Install the Automation Agent with rpm Packages

Overview

Cloud Manager Automation relies on an Automation Agent, which must be installed on every server that runs a monitored MongoDB deployment. The Automation Agents periodically poll Cloud Manager to determine the goal configuration, deploy changes as needed, and report deployment status back to Cloud Manager.

Automation Agents can run only on 64-bit architectures.

Use this procedure to install the agent on RHEL, CentOS, SUSE, Amazon Linux, and other systems that use rpm packages.

If you cannot install to a host using the rpm package, install the agent using an archive. Ensure this agent runs as the same system user as the MongoDB process.

Prerequisites

Server Networking Access

The hosts that serve the MongoDB deployments must:

  • Have full networking access to each other through their fully qualified domain names (FQDNs). Each host must be able to reach every other host through the FQDN.

    To find the FQDN for each host:

    • On Linux / macOS hosts, run the following command in the Terminal:

      hostname -f
      
    • On Windows hosts, run the following command in Powershell:

      net config workstation | findstr /C:"Full Computer name"
      
  • Resolve each FQDN to a unique IP address.

    Run the following domain internet groper (dig) shell command to find the host’s IP address.

    dig +short myip.opendns.com @resolver1.opendns.com
    

    Note

    dig is available for Microsoft Windows. Download and install the BIND tools from http://www.isc.org/downloads/

  • Set the Common Name or Subject Alternative Name value of any SSL certificates to the MongoDB host’s FQDN.

The network configuration must allow each Automation Agent to make a direct connection to every MongoDB deployment listed on the Deployment page. Cloud Manager does not support port forwarding.

Installing to a Server that Already Runs MongoDB

If you install the Automation Agent to a server that is already running a MongoDB process, the agent must have:

  • Permission to stop the MongoDB process. The Automation Agent will restart the process using the agent’s own set of MongoDB binaries. If you had installed MongoDB with a package manager, use the same package manager to install the Automation Agent. This gives the agent the same owner as MongoDB.
  • Read and Write permissions on the MongoDB data directory and log directory.
  • Permission to stop, start, and update any existing Monitoring and Backup Agents.

Installing to a Server Before Installing MongoDB

If you deploy the Automation Agent to a server that does not have MongoDB installed, ensure the user that owns the Automation Agent has Read and Write permissions on the MongoDB data and log directories you plan to use.

Procedures

This section includes procedures for both installing and updating the Automation Agent.

Install the Automation Agent with an rpm Package

Installation Tip for Binding the Agent to a Project

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 the latest version of the Automation Agent archive.

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

For RHEL / CentOS (7.x) and SUSE 12 on x64 architecture:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rhel7.rpm

For RHEL / CentOS (7.x) on PowerPC architecture (managing MongoDB 3.4 or later deployments only):

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.ppc641e.rhel7.rpm

For RHEL/CentOS (5.X, 6.X), SUSE 11, and Amazon Linux on x64 architecture:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rpm
2

Install the Automation Agent Package

For RHEL / CentOS (7.x) and SUSE 12 on x64 architecture:

sudo rpm -U mongodb-mms-automation-agent-manager-latest.x86_64.rhel7.rpm

For RHEL / CentOS (7.x) on PowerPC architecture (managing MongoDB 3.4 or later deployments only):

sudo rpm -U mongodb-mms-automation-agent-manager-latest.ppc641e.rhel7.rpm

For RHEL/CentOS (5.X, 6.X), SUSE 11, and Amazon Linux on x64 architecture:

sudo rpm -U mongodb-mms-automation-agent-manager-latest.x86_64.rpm
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 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.

  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 automation-agent.config file.

Edit the automation-agent.config file.

sudo vi /etc/mongodb-mms/automation-agent.config

For mmsGroupId, enter your ProjectID as the value. For mmsApiKey, enter the project’s agent API key.

mmsGroupId=<Project ID>
mmsApiKey=<agent API key>

For SUSE 11+ deployments only, configure the sslTrustedMMSServerCertificate setting.

sslTrustedMMSServerCertificate=/etc/ssl/certs/UTN_USERFirst_Hardware_Root_CA.pem
5

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

To configure the agent to connect to Cloud Manager via a proxy server, you must specify the server in the httpProxy environment variable. In the /etc/mongodb-mms/automation-agent.config file, set the httpProxy value to the URL of to your proxy server:

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

Prepare the data directory.

The data directory stores MongoDB data and must be owned by the `mongod` user. For an existing MongoDB deployment, ensure the directory has the mongod user as owner. If no MongoDB deployment exists, create the directory and set the owner.

The following commands create a data directory and set the owner as the mongod user:

sudo mkdir /data
sudo chown mongod:mongod /data
7

Start the Automation Agent.

Issue the following command:

sudo service mongodb-mms-automation-agent start

Update the Automation Agent with an rpm Package

Important

If any Automation Agent for any deployment is out of date, Cloud Manager displays a warning on the Deployment page.

If you use this procedure, you do not need to stop the agent. The update package automatically stops, unpacks, and then restarts the agent.

1

Download the latest version of the Automation Agent archive.

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

For RHEL / CentOS (7.x) and SUSE 12 on x64 architecture:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rhel7.rpm

For RHEL / CentOS (7.x) on PowerPC architecture (managing MongoDB 3.4 or later deployments only):

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.ppc641e.rhel7.rpm

For RHEL/CentOS (5.X, 6.X), SUSE 11, and Amazon Linux on x64 architecture:

curl -OL https://cloud.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager-latest.x86_64.rpm
2

Install the Automation Agent Package

For RHEL / CentOS (7.x) and SUSE 12 on x64 architecture:

sudo rpm -U mongodb-mms-automation-agent-manager-latest.x86_64.rhel7.rpm

For RHEL / CentOS (7.x) on PowerPC architecture (managing MongoDB 3.4 or later deployments only):

sudo rpm -U mongodb-mms-automation-agent-manager-latest.ppc641e.rhel7.rpm

For RHEL/CentOS (5.X, 6.X), SUSE 11, and Amazon Linux on x64 architecture:

sudo rpm -U mongodb-mms-automation-agent-manager-latest.x86_64.rpm
3

Prepare the data directory.

The data directory stores MongoDB data and must be owned by the `mongod` user. For an existing MongoDB deployment, ensure the directory has the mongod user as owner. If no MongoDB deployment exists, create the directory and set the owner.

The following commands create a data directory and set the owner as the mongod user:

sudo mkdir /data
sudo chown mongod:mongod /data