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.

Install On Prem MMS for Development and Testing

On this page

Warning

This setup is not suitable for a production deployment.

Overview

MMS On Prem is a package that lets you run the MongoDB Management Service (MMS) on site. MMS monitors and backs up your MongoDB infrastructure.

On Prem MMS uses the components described in On Prem MMS Components. In a test deployment, you can run an entire On Prem MMS deployment on a single system as in the Minimal Deployment diagram. You will deploy a replica set for testing on a separate system.

The minimal deployment is for testing and development purposes only. Running on a single server is not* suitable for production deployments.

Procedures

Set up the On Prem Service

1

Set up a server and firewall.

Prepare the server that will run

  • the MMS On Prem components,
  • the Application Database, and
  • the Backup Blockstore Database.

Use a RHEL 6+ or Amazon Linux Server with at least:

  • 15 GB of memory
  • 50 GB of disk space for the root partition

For example, you can meet the size requirements by using an AWS EC2 m3.xlarge instance and changing the size of the root partition from 8 GB to 50 GB. When you log into the instance, execute “df -h” to verify the root partition has 50 GB of space.

Set up a firewall or EC2 Security Group that:

  • Allows administrators to SSH into the server.
  • Allows MMS users to connect from browsers to ports 8080 and 8081 through the server’s public IP address.
2

Configure ulimits.

Remove the default ulimit settings that come with the operating system:

sudo rm /etc/security/limits.d/90-nproc.conf

Edit the /etc/security/limits.conf file to configure the following settings:

* soft nofile 64000
* hard nofile 64000
* soft nproc 32000
* hard nproc 32000
3

Install MongoDB 2.6.

Install MongoDB following the procedure in the MongoDB manual.

4

Download the MMS Application Package.

Download the latest version of the MMS Application Package from the MMS downloads page. The MMS Application Package is listed as “Monitoring and Core” on the downloads page.

Download the On Prem MMS Package by issuing the following command. Substitute the MMS version for <version>:

sudo curl -OL https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-<version>.x86_64.rpm

For example, for version 1.5.0.130 issue:

curl -OL https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-1.5.0.130.x86_64.rpm
5

Install the MMS Application Package.

Install the package using the following command, where <version> is the MMS version:

sudo rpm --install mongodb-mms-<version>.x86_64.rpm

For example, for version 1.5.0.130 issue:

sudo rpm --install mongodb-mms-1.5.0.130.x86_64.rpm
6

Download the Backup Daemon Package.

Alternately, you can download the package by issuing the following command, where <version> is the MMS version:

curl -OL https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-backup-daemon-<version>.x86_64.rpm

For example, for version 1.5.0.130 issue:

curl -OL https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-backup-daemon-1.5.0.130.x86_64.rpm
7

Install the Backup Daemon Package.

Install the package using the following command, where <version> is the MMS version:

sudo rpm --install mongodb-mms-backup-daemon-<version>.x86_64.rpm

For example, for version 1.5.0.130, you would issue the following:

sudo rpm --install mongodb-mms-backup-daemon-1.5.0.130.x86_64.rpm
8

Set up the two backing databases.

Create a data directory for each backing database and set mongod.mongod as each data directory’s owner. The backing databases are the MMS Application Database and MMS Backup Blockstore Database.

The following command creates two data directories, one for each backing database. You can use different directory names:

sudo mkdir -p /data /data/mmsdb /data/backupdb

The following command sets mongod.mongod as owner of the new directories:

sudo chown mongod:mongod /data /data/mmsdb /data/backupdb
9

Start the MongoDB instances for the two backing databases.

Start each MongoDB instance using the mongod daemon and specifying mongod as the user. Start each instance on its own dedicated port number and with the data directory you created in the last step.

The following two commands start separate instances for the MMS Application Database and for the Backup Blockstore Database:

sudo -u mongod mongod --port 27017 --dbpath /data/mmsdb --logpath /data/mmsdb/mongodb.log --fork

sudo -u mongod mongod --port 27018 --dbpath /data/backupdb --logpath /data/backupdb/mongodb.log --fork
10

Configure the MMS Application Service.

Edit /opt/mongodb/mms/conf/conf-mms.properties. Set values for the following properties, substituting your install’s values for <public_ip> and mms-admin@example.net:

mms.centralUrl=http://<public_ip>:8080
mms.backupCentralUrl=http://<public_ip>:8081

mms.fromEmailAddr=mms-admin@example.net
mms.replyToEmailAddr=mms-admin@example.net
mms.adminFromEmailAddr=mms-admin@example.net
mms.adminEmailAddr=mms-admin@example.net
mms.bounceEmailAddr=mms-admin@example.net

mongo.mongoUri=mongodb://127.0.0.1:27017/
11

Start the MMS Application Service.

Issue the following command:

sudo service mongodb-mms start
12

Open the MMS On Prem home page.

Enter the following URL in a browser, where <public_ip> is the public IP address of the server:

http://<public_ip>:8080
13

Configure the MMS Backup Daemon.

Edit /opt/mongodb/mms-backup-daemon/conf/conf-daemon.properties to configure the the following settings:

mongo.mongoUri=mongodb://127.0.0.1:27017/

mongo.backupdb.mongoUri=mongodb://127.0.0.1:27018/
14

Start the MMS Backup Daemon.

Issue the following command:

sudo service mongodb-mms-backup-daemon start

Begin Monitoring and Backing Up a Replica Set

The following procedure creates a three-member replica set, populates it with data, and then uses the On Prem Service to monitor and backup the replica set.

1

Set up the server that will run the MongoDB replica set.

Use a RHEL 6+ or Amazon Linux Server with at least:

  • 3 GB of memory.
  • 50 GB of disk space for the root partition.

For example, you can meet the size requirements by using an AWS EC2 m3.medium instance and changing the size of the root partition from 8 to 50 gigabytes. When you log into the instance, use “df -h” to verify the root partition has 50 gigabytes of space.

2

Configure ulimits.

Remove the default ulimit settings that come with the operating system:

sudo rm /etc/security/limits.d/90-nproc.conf

Edit the /etc/security/limits.conf file to configure the following settings:

* soft nofile 64000
* hard nofile 64000
* soft nproc 32000
* hard nproc 32000
3

Install MongoDB.

Use the following series of commands to install MongoDB.

Set up a repository definition by issuing the following command:

echo "[MongoDB]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1" | sudo tee -a /etc/yum.repos.d/mongodb.repo

Install MongoDB by issuing the following two commands:

sudo yum install -y mongodb-org mongodb-org-shell
4

Create the data directories for the replica set.

Create a data directory for each replica set member and set mongod.mongod as each data directory’s owner.

The following command creates the directory /data and then creates a data directory for each member of the replica set. You can use different directory names:

sudo mkdir -p /data /data/nodea /data/nodeb /data/nodec

The following command sets mongod.mongod as owner of the new directories:

sudo chown mongod:mongod /data /data/nodea /data/nodeb /data/nodec
5

Start a separate MongoDB instance for each replica set member.

Start each mongod instance on its own dedicated port number and with the data directory you created in the last step. For each instance, specify mongod as the user. Start each instance with the replSet command-line option specifying the name of the replica set.

The following three commands start separate instances for each member of a new replica set named example:

sudo -u mongod mongod --port 27017 --dbpath /data/nodea --replSet example --logpath /data/nodea/mongodb.log --fork

sudo -u mongod mongod --port 27018 --dbpath /data/nodeb --replSet example --logpath /data/nodeb/mongodb.log --fork

sudo -u mongod mongod --port 27019 --dbpath /data/nodec --replSet example --logpath /data/nodec/mongodb.log --fork
6

Initiate the replica set.

Connect to one of the members and initiate the replica set using the rs.initiate() method. Add the other members using the rs.add() method. The rs.add() method requires the hostame of the server: if necessary, first execute the hostname command to determine the name.

Use the following sequence of commands to initiate the replica set and add members. Replace <hostname> with the hostname of your server. The commands use the mongod running on port 27017 to initiate the set and add the other members.

mongo --port 27017 --eval "rs.initiate()";

mongo --port 27017 --eval "rs.add("<hostname>:27018")";

mongo --port 27017 --eval "rs.add("<hostname>:27019")";
7

Connect to the replica set and verify the replica set configuration.

To connect to the replica set, issue the mongo command:

mongo

To verify the configuration, issue the rs.status() method:

rs.status()

Verify that the members array lists the three members. For a full description of the output, see the explanation in replSetGetStatus.

8

Add data to the replica set.

While still connected to the replica set, issue the following for loop to create a collection titled testData and populate it with 25,000 documents, each with an _id field and a field x set to a random string.

for (var i = 1; i <= 25000; i++) {
  db.testData.insert( { x : Math.random().toString(36).substr(2, 15) } );
  sleep(0.1);
}
9

Register the first user.

Click the Register link and enter the user’s information. When you finish, you will be logged into the MMS application.

# The registration email will be sent to the address you specified in # conf-mms.properties.

For more information on creating and managing users, see Manage Users.

10

Set up the Monitoring Service for the replica set.

On the Welcome page, click the Get Started button for Monitoring. If the Welcome page is not visible, click the Settings tab to refresh MMS and then click the Setup tab to display the Welcome page.

After you click Get Started, follow the instructions, which will take you through steps to download, configure, and run the Monitoring Agent.

When the agent is running, the instructions prompt you to add a host. On the Add a Host page, enter the hostname and port of the replica set member running on port 27017. For example, enter <hostname>:27017, replacing <hostname> with the hostname of the server running the replica set.

When you finish the instructions, the Monitoring Agent is running and monitoring the replica set.

11

Set up the Backup Service for the replica set.

On the Welcome page, click the Get Started button for Backup. If the Welcome page is not visible, click the Settings tab to refresh MMS and then click the Setup tab to display the Welcome page.

After you click Get Started, follow the instructions to set up the Backup Service. When you reach the Enable Backup page, select the example replica set, which is the set you created when initializing the replica set members. If you chose a different name when initializing the members, choose that name here instead.

When you finish the instructions, the Backup Agent is running and backing up the replica set. It may take up to 30 minutes for the first snapshot to complete, even for a very small replica set.

While you are waiting, this is a good time to take a tour of your MMS Backup environment.