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 Multiple Blockstores in Multiple Data Centers

On this page

Overview

The Backup Blockstore Databases are the primary storage systems for the backup data of your MongoDB deployments. If needed, you can deploy multiple blockstores in multiple data centers, each backing up different MongoDB replica sets and sharded clusters. You can attach a particular MMS Group to a particular MMS Application instance and blockstore.

Add additional blockstore instances when:

  • existing blockstores have reached capacity.
  • two sets of backed up data that that cannot have co-located storage for regulatory reasons.
  • you have multiple data centers and want to reduce cross-data center network traffic by keeping each blockstore in the data center it backs.

This tutorial describes how to set up two blockstores in two separate data centers.

Procedures

The following procedures set up two blockstores in two data centers.

Provision Servers in Each Data Center

Each blockstore requires a separate instance of the MMS Application and the Backup Daemon. The MMS Application requires a dedicated MMS Application Database.

To provide failover for the Backup Blockstore Database and the Application Database, deploy a replica set as the backing MongoDB instance for each. Each backing MongoDB instance is dedicated to the database it hosts and does not store any other data.

Each data center should have the following servers:

Optionally, for high availability, a data center can have additional servers to run additional Backup Daemons and Backup Blockstore Databases. For more information on using multiple Backup Daemons for high availability, see Multiple Backup Daemons.

Install MongoDB and Deploy Replica Sets

On both MMS Application servers in each data center and on both Backup Daemon servers in each data center:

  1. Install the MongoDB software package. See the MongoDB Installation tutorials to find the correct install procedure for your operating system. Perform only the installation procedure and not the start procedure.

  2. Create the necessary data directories.

    On the first MMS Application or Backup Daemon server in each data center, issue the following commands:

    mkdir /data/db
    mkdir /data/arb
    

    On the second MMS Application or Backup Daemon server in each data center, issue the following command:

    mkdir /data/db
    
  3. Set ulimits. Set the maximum number of open file descriptors and maximum number of processes available to a single user to 64000:

    ulimit -n 64000 -u 64000
    
  4. Deploy a replica set to host the database. Issue the following commands.

    On the first MMS Application or Backup Daemon server in each data center, issue the following commands to deploy the first two members of the replica set:

    mongod --dbpath /data/db --fork --logpath /tmp/mongo.log --replSet rs
    mongod --dbpath /data/arb -fork --logpath /tmp/arb.log --replSet rs --port 27018
    

    Then, start a mongo shell connected to the first instance:

    mongo
    

    Now use the rs.initiate() to create the new replica set:

    rs.initiate()
    

    On the second MMS Application or Backup Daemon server in each data center, issue the following command:

    mongod --dbpath /data/db --fork --logpath /tmp/mongo.log --replSet rs
    

    On the first MMS Application or Backup Daemon server in each data center, issue the following to enter the mongo shell, add the deployed members to the replica set, and then verify that the members were added:

    mongo
    
    rs.add("<hostname-of-second-server>:<port>")
    rs.addArb("<hostname-of-first-server>:<port>")
    rs.status()
    

    Issue the following to exit the mongo shell:

    quit()
    

At this point, you have replica sets running for all the backing databases.

Install the MMS Application

On the first MMS Application server in each data center, install the MMS Application using the procedure appropriate to the operating system. Open the list of install procedures and go to the page specific to your OS. Perform the procedure to install the service but do not perform the step to start the service.

In the step for configuring the conf-mms.properties file, set the following fields as follows:

mms.centralUrl = <first-MMS-Application-server>:<8080>

mms.centralBackupUrl = <first-MMS-Application-server>:<8081>

mongo.mongoUri=mongodb://<first-MMS-Application-mongod>:<27017>,<second-MMS-Application-mongod>:<27017>

mongo.replicaSet=rs

Install the Backup Daemon

On the first Backup Daemon server in each data center, install the Backup Daemon using the procedure appropriate to your operating system. Perform the procedure for installing the Backup Component, including the step to start the service.

In the step for configuring the conf-daemon.properties file, set the following fields as follows:

mongo.mongoUri=mongodb://<MMS-application-database-Data-Center-1>:<27017>,<MMS-application-database-in-Data-Center-2>:<27017>

mongo.replicaSet=rs

mongo.backupdb.mongoUri=mongodb://<blockstore-in-Data-Center-1>:<27017>

mongo.backupdb.replicaSet=rs

See mongo.mongoUri and mongo.backupdb.mongoUri for more information.

Copy the gen.key

The /etc/mongodb-mms/gen.key from the first MMS Application Server in Data Center 1 will be the gen.key for all servers in both data centers.

  1. Copy the /etc/mongodb-mms/gen.key from the first MMS Application Server in Data Center 1 to the /etc/mongodb-mms directory on the first MMS Application Server in Data Center 2.
  2. Copy this gen.key to the /etc/mongodb-mms directory of each Backup Daemon server.

Start the MMS Application Service

  1. On the first MMS Application server in Data Center 1, issue the following:

    service mongodb-mms start
    
  2. On the first MMS Application server in Data Center 2, issue the following:

    service mongodb-mms start
    

Bind Groups to Daemons

  1. In a web browser, go to the URL for the MMS Application in Data Center 1:

    <first-MMS-Application-server>:<8080>
    
  2. Register a new account, with the group set to a particular data center.

    To test this, go to the URL for the MMS Application Server in Data Center 2 and try to log in with the new account. It should succeed.

  3. Once logged into On-Prem MongoDB Management Service, select the Users tab. Create new group for other data center.

    You should now have one group for each data center.

  4. In On-Prem MongoDB Management Service, select the Admin and then select Backup. Do the following:

    • Select Daemons and ensure there are two daemons listed.
    • Select Blockstores. Add a blockstore with the hostname and port for Data Center 2 and click Save.
    • Select Sync Stores. Add a sync store with the hostname and port for Data Center 2 and click Save.
    • Select Oplog Stores. Add an oplog store with the hostname and port for Data Center 2 and click Save.
  5. Select the General tab, then select Groups, then select Data Center 1, and then select the View link for the Backup Configuration.

  6. For each of the following, click the drop-down box and select the local option for the group:

    • Backup Daemons
    • Sync Stores
    • Oplog Stores
    • Block Stores
  7. Repeat the above steps for the Data Center 2 group.

  8. For all users in Data Center 1, download the Monitoring and Backup agents from the group assigned to Data Center 1. For all users in Data Center 2, download the Monitoring and Backup agents from the group assigned to Data Center 2.

    See the following pages for the procedures for installing the agents: