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.

Configure Backup Agent for MONGODB-CR

If your MongoDB deployment enforces access control, the Ops Manager Backup Agent must authenticate to MongoDB as a user with the proper access.

To authenticate using MONGODB-CR, create a user in the admin database with the appropriate roles in MongoDB.

MongoDB user roles are separate from Ops Manager user roles and are described in the MongoDB manual beginning with the Authorization page.

Considerations

To authenticate to sharded clusters, create shard-local users on each shard and create cluster-wide users:

  • Create cluster users while connected to the mongos; these credentials persist to the config servers.
  • Create shard-local users by connecting directly to the replica set for each shard.

Prerequisites

Connect to the mongod or mongos instance as a user with access to create users in the database. See db.createUser() method page for more information.

3.0 and Later

To backup MongoDB instances running 3.0 and later, create a user in the admin database with an operation that resembles the following:

use admin
db.createUser(
   {
     user: "<username>",
     pwd: "<password>",
     roles: [ { role: "backup", db: "admin" } ]
   }
)

See Access Control for MongoDB 3.0 for more information on the required access.

MongoDB 2.6

To backup MongoDB 2.6 release series instances, create a user in the admin database with an operation that resembles the following:

use admin
db.createUser(
   {
     user: "<username>",
     pwd: "<password>",
     roles: [
        "clusterAdmin",
        "readAnyDatabase",
        "userAdminAnyDatabase",
        { role: "readWrite", db: "admin" },
        { role: "readWrite", db: "local" },
     ]
   }
)

See Access Control for MongoDB 2.6 for more information on the required access.

MongoDB 2.4

To backup MongoDB 2.4 release series instances, create a user in the admin database with an operation that resembles the following:

use admin
db.addUser(
   {
     user: "<username>",
     pwd: "<password>",
     roles: [
        "clusterAdmin",
        "readAnyDatabase",
        "userAdminAnyDatabase"
     ],
     otherDBRoles: {
        local: ['readWrite'],
        admin: ['readWrite'],
        config: ['readWrite']
     }
   }
)

See Access Control for MongoDB 2.4 for more information on the required access.

Host Settings

In addition to adding the agent as a MongoDB user, you must also specify the host’s authentication settings. You can specify the host’s authentication settings when adding the host, or you can edit the settings for an existing host.