Introduction to Import Existing Deployment for Automation



Why Import for Automation?

Until today, it was only possible to manage new deployments with MMS Automation. Starting today, you can get the benefits of Automation on the vast majority of your pre-existing deployments. Automation allows you to turn long and complicated manual processes into single click operations with MMS.

We’ve tried to minimize the amount of work you’ll need to do in order to attach MMS to your pre-existing deployments. In some cases some re-configuration will be necessary, and some deployment types aren’t yet supported, but stay tuned.

Getting Started

To successfully import, please check your deployment meets the following requirements:

  1. You have a Monitoring Agent and your deployment is monitored. If you have no MMS Agents running:
    • Install an Automation Agent on every server in the deployment. Instructions for installing Automation Agents can be found at Administration -> Agents
    • Use MMS Automation to deploy a Monitoring Agent. See docs here.
  2. The fully qualified domain name (“hostname -f”) for each server in the deployment must be resolvable from every other server. For example, if you login to Server A, and “hostname -f” returns, then this address must be resolvable from Server B, C and D as well.
  3. If you are using MongoDB authentication, you must configure a MongoDB user account that the Automation Agents will use to authenticate to your deployment.
          use admin
          db.createUser({user: "mms-automation", pwd: "yourpassword", roles: ['clusterAdmin', 'dbAdminAnyDatabase', 'readWriteAnyDatabase', 'userAdminAnyDatabase','restore']})
    Please note that if you are importing a sharded cluster, this user must be created via the mongos, as well as on every shard. The same username and password must be used throughout.
  4. Your deployment makes use only of supported MongoDB configuration file options. See docs here.
  5. The MongoDB processes that are being imported must be running as the same system user as the Automation Agent. For example, if your MongoDB process is running as the “mongod” user, the Automation Agent must also be run as the “mongod” user.
  6. If you wish to import multiple replica sets or clusters that are using MongoDB authentication, they must all use the same keyFile.

How It Works

To start the process, click on the green Add button and choose Import Existing for Automation.

The first step is to choose the item you would like to import. You will be presented with a list of all the sharded clusters, replica sets and standalones that you are currently monitoring in MMS. In this example, we’re going to import a replica set called “leaf”.

If you are using MongoDB authentication, you will additionally be asked to enter the username and password for the MongoDB user account you prepared for the Automation Agent user.

Once you click Start Import, the Automation Agents will query each process for detailed information about its current state. The Automation Agents will also gather information about any users and custom roles defined in your deployment. This information is sent back to MMS, which uses this information to construct a detailed map of your deployment.

When this process is complete, you will be invited to view the draft deployment:

The draft deployment might look like this:

The final step is to “Review & Deploy” your changes. After clicking this you will be given one last preview, and then configuration will be broadcast to the Automation Agents.

When the Automation Agents receive the new configuration, they will initiate a rolling restart of the new processes. When this completes, your deployment will be in “Goal state”.

Uh-Oh, It Doesn’t Seem To Be Working

When the Automation Agents gather information about the state of your deployment, we also perform extensive validation to ensure that your deployment is suitable for import.

However, if we missed something, and things don’t seem to be going well, you can always Unmanage any item from your deployment. When you Unmanage the item, it is removed from the configuration for the Automation Agents. The Automation Agents will not shutdown the processes, they will simply stop interacting with them.