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 the On-Prem Monitoring Server

Requirements

Hardware

To run the On-Prem Monitoring server, you must use a 64-bit server, with requirements according to the following table:

Number of Monitored Hosts CPU Cores RAM Storage Capacity Storage IOPS/s
Up to 400 monitored hosts 4+ 15 GB 200 GB 500
Up to 2000 monitored hosts 8+ 15 GB 500 GB 10000+ (SSD)
More than 2000 hosts Contact MMS      

For reference: an AWS EC2 Standard Extra Large (i.e. m1.xlarge) with a provisioned 500 IOP/s EBS volume supported the 400-host configuration above. An AWS EC2 High I/O Quadruple Extra Large (hi1.4xlarge) supported the 2000 host configuration above.

For the best results, On-Prem MMS instances require SSD-backed storage.

Software

On Prem MMS Monitoring has the following required dependencies:

  • 64-bit Linux. On-Prem MMS servers must run any of the following distributions:
    • CentOS 5 or later,
    • Red Hat Enterprise Linux 5, or later, or
    • SUSE 11 or Later,
    • Amazon Linux AMI (latest version only,)
    • Ubuntu 12.04 or later.
  • MongoDB 2.2.0 or later.
  • SMTP server or other email integration option.

While many Linux server-oriented distributions include a local SMTP server by default (e.g. Postfix, Exim, Sendmail,) you may also configure On Prem MMS Monitoring to send mail via 3rd party providers including Gmail and Sendgrid.

On Prem MMS Monitoring requires email for fundamental server functionality such as password reset and alerts.

On Prem MMS Monitoring has the following optional dependencies.

  • A Twilio API account for SMS alerting integration.
  • A Graphite hostname / port for charting the MMS server’s internal health.
  • An SNMP trap receiver for periodic heartbeat traps about MMS server’s internal health.

Browsers

On Prem MMS Monitoring supports the following browsers:

  • recent versions of Firefox, Chrome, and Safari
  • Internet Explorer, Versions 9 and later.

The On Prem MMS Monitoring application will display a warning on non-supported browsers.

Installation Process

Overview

At a high level, a basic installation will look like the following. The estimated setup time is less than an hour.

  1. Install a standalone local MongoDB server backed by a fast, large storage volume.
  2. Install an SMTP email server as appropriate for your environment.
  3. Install the MMS server RPM package.
  4. Configure the MMS server’s URL and email addresses.
  5. Start up MMS server.

Prepare Server

  1. For AWS users, prepare MongoDB Storage:

    If you are not using AWS, skip this step and continue to the next step.

    If using an AWS EBS volume for MongoDB storage, create and attach the volume to your EC2 instance. Once the volume is successfully attached, issue the following command to determine the name of the new EBS volume:

    sudo fdisk -l
    

    Create a filesystem on this volume using the name you found in the previous, command, using the following form:

    sudo mkfs -t ext4 /dev/xvd<letter>
    

    Replace <letter> with the identifier for the volume, as in the following example:

    sudo mkfs -t ext4 /dev/xvdf
    

    You only need to create a filesystem the first time you initiate the drive.

    Create a directory to use as the mount point:

    sudo mkdir /mnt/ebs-mount-dir
    

    Mount the volume with a command that resembles the following:

    sudo mount /dev/xvd<letter> /mnt/ebs-mount-dir
    

    Replace <letter> with the identifier for the volume, as in the following example:

    sudo mount /dev/xvdf /mnt/ebs-mount-dir
    
  2. Set Linux Kernel parameters. All users must complete this step to ensure optimal performance. Begin by using the following commands to change the parameters of running instance:

    sudo /sbin/sysctl -w net.core.netdev_max_backlog=30000
    sudo /sbin/sysctl -w net.core.wmem_max=16777216
    sudo /sbin/sysctl -w net.core.rmem_max=16777216
    

    Edit the /etc/sysctl.conf file and append the lines below to ensure that these parameters are always applied following a system reboot:

    net.core.netdev_max_backlog = 30000
    net.core.wmem_max = 16777216
    net.core.rmem_max = 16777216
    

Install and Start MongoDB

This section assumes you’re installing MongoDB on an instance running Red Hat, CentOS, Fedora, or Amazon Linux: Use the Install Mongodb on Red Hat, CentOS, or Fedora Linux tutorial for more information.

  1. Add MongoDB repositories to the system’s package management tool.

    Create the /etc/yum.repos.d/mongodb.repo file and add the following information about the repository:

    [mongodb]
    name=MongoDB Repository
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
    gpgcheck=0
    enabled=1
    
  2. Install the MongoDB packages using the following operations:

    sudo yum install mongo-10gen mongo-10gen-server
    
  3. Configure data and logging directories for MongoDB.

    Create directories for MongoDB’s log and data. This example assumes that the path for all MongoDB data is beneath /mnt/ebs-mnt-dir/mongo/. Use the following commands:

    sudo mkdir -p /mnt/ebs-mount-dir/mongo/data
    sudo mkdir -p /mnt/ebs-mount-dir/mongo/logs
    

    Issue the following command to ensure that the mongod process owns all paths below the /mnt/ebs-mnt-dir/mongo/ path:

    sudo chown -R mongod:mongod /mnt/ebs-mount-dir/mongo
    

    Edit the /etc/mongod.conf to include the following settings:

    logpath=/mnt/ebs-mount-dir/mongo/logs/mongod.log
    dbpath=/mnt/ebs-mount-dir/mongo/data
    

    This will configure the paths for the log and data directories. Adjust the paths as needed.

  4. Start MongoDB.

    Issue the following command:

    sudo /etc/init.d/mongod start
    

    Note

    If using EBS, starting MongoDB may take several minutes to pre-allocate the journal files. This is normal behavior.

Obtain and Install On-Prem MMS Server

Note

Contact a MongoDB representative to obtain the current stable On Prem MMS Monitoring release. MMS is available in DEB packages for Debian, Ubuntu, and related systems; RPM for Red Hat Enterprise Linux, CentOS, Fedora, and related systems; as well as tar.gz and zip packages.

You can also download the latest On-Prem Monitoring releases from <http://www.mongodb.com/commercialsupport/downloads> as an RPM package.

RPM Install

Install the RPM by issuing command in the following form:

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

Replace <version> with the version of the .rpm you obtained. When installed, the base directory for the MMS software is /opt/mongodb/mms/. The RPM will also create a new system user mongodb-mms under which the server will run.

DEB Install

Install the DEB by issuing command in the following form:

sudo dpkg --install mongodb-mms-<version>.x86_64.deb

Replace <version> with the version of the .deb you obtained. When installed, the base directory for the MMS software is /opt/mongodb/mms/. The DEB package will also create a new system user mongodb-mms under which the server will run.

tar.gz and zip Install

You can install On Prem MMS Monitoring from the provided tar.gz or zip archive without making any changes to the underlying system (i.e. without creating users.) To install, extract the package, as in the following command:

tar -zxf mongodb-mms-<version>.x86_64.tar.gz

Optionally create a symlink in /etc/init.d to the included control script for convenience, as in the following:

sudo ln -s <install_dir>/bin/mongodb-mms /etc/init.d/

Note, when the app is first started, it will create and store an encryption key in $HOME/.mongodb-mms for the app user.

Configure On-Prem MMS Server

This section describes the required configuration for the On-Prem MMS Server. See Advanced Configuration for more configuration information.

Required Configuration

Note

By default, On Prem MMS Monitoring will use a local SMTP server listening on port 25.

Configure MMS properties, by editing the <install_dir>/conf/conf-mms.properties file. Edit the following properties according to the needs of your deployment, as in the following example:

mms.centralUrl=http://mms.example.com:8080

mms.fromEmailAddr=MMS Alerts <mms-alerts@example.com>
mms.replyToEmailAddr=mms-no-reply@example.com
mms.adminFromEmailAddr=MMS Admin <mms-admin@example.com>
mms.adminEmailAddr=mms-admin@example.com
mms.bounceEmailAddr=bounce@example.com

These properties are blank initially, and you must define them before the On Prem MMS Monitoring instance will start.

In addition, whether or not you enable backup, define these properties if you use authentication:

mongo.mongoUri=<SetToValidUri>
mongo.replicaSet=<ValidRSIfUsed>

Otherwise, MMS will fail while trying to connect to the default 127.0.0.1:27017 URL.

If you use the MMS <install_dir>/bin/credentialstool to encrypt the password used in the mongo.mongoUri value, also add the mongo.encryptedCredentials key to the <install_dir>/conf/conf-mms.properties file and set the value for this property to true:

mongo.encryptedCredentials=true

For more details, see Authentication Configuration below.

Configure Email Authentication

Please refer to your SMTP provider’s documentation for the appropriate settings or for how to configure a local SMTP server as a relay. You may configure authentication if you want to send mail using existing email infrastructure (i.e. SMTP,) or a service such as Gmail or Sendgrid .

Set the following value in the <install_dir>/conf/conf-mms.properties file:

mms.emailDaoClass=com.xgen.svc.core.dao.email.JavaEmailDao

Then, to the same file, set the following values as defined by your provider. Defaults specified inline:

mms.mail.transport=<smtp/smtps> # (defaults to smtp)
mms.mail.hostname=<mail.example.com> # (defaults to localhost)
mms.mail.port=<number> # (defaults to 25)
mms.mail.tls=<true/false> # (defaults to false)

The following two values are optional, and unless set default to disabled authentication:

mms.mail.username=
mms.mail.password=

Optional: AWS Simple Email Service Configuration

Set the following value in <install_dir>/conf/conf-mms.properties to configure integration with AWS’s Simple Email Service (SES:)

mms.emailDaoClass=com.xgen.svc.core.dao.email.AwsEmailDao

To configure this integration you must also provide your AWS account credentials in the following two properties:

aws.accesskey=
aws.secretkey=

Start and Stop the On-Prem MMS Server

After configuring your On Prem MMS Monitoring deployment, you can start the MMS server with the following command: [1]

sudo /etc/init.d/mongodb-mms start

The On-Prem MMS server logs its output to a logs directory inside the installation directory. You can view this log information with the following command:

sudo less <install_dir>/logs/mms0.log

If the server starts successfully, you will see content in this file that resembles the following:

[main] INFO  ServerMain:202 - Starting mms...
[main] WARN  AbstractConnector:294 - Acceptors should be <=2*availableProcessors: SelectChannelConnector@0.0.0.0:0
[null] LoginService=HashLoginService identityService=org.eclipse.jetty.security.DefaultIdentityService@1eb3319f
[main] INFO  AppConfig:46 - Starting app for env: hosted
[main] INFO  MmsAppConfig:67 - Not loading backup components
[main] INFO  GraphiteSvcImpl:67 - Graphite service not configured, events will be ignored.
[main] INFO  TwilioSvcImpl:48 - Twilio service not configured, SMS events will be ignored.
[main] INFO  OpenDMKSnmpTrapAgentSvcImpl:91 - SNMP heartbeats hosts not configured, no heartbeat traps will be sent.
[main] INFO  ServerMain:266 - Started mms in: 24979 (ms)

You can now use the On Prem MMS Monitoring instance by visiting the URL specified in the mms.centralUrl parameter (e.g. http://mms.example.com:8080) to continue configuration:

Unlike the SaaS version of MMS, On Prem MMS Monitoring stores user accounts in the local MongoDB instance. When you sign into the On Prem MMS Monitoring instance for the first time, the system will prompt you to register and create a new “group” for your deployment.

After completing the registration process, you will arrive at the “MMS Hosts,” page.

Because there are no Monitoring agents attached to your account, the first page you see in On Prem MMS Monitoring will provide instructions for downloading the Monitoring agent. Click the “download agent” link to download a pre-configured agent for your account. Continue reading this document for installation and configuration instructions for the MMS agent.

Stopping the On-Prem MMS server is as follows:

sudo /etc/init.d/mongodb-mms stop

Advanced Configuration

Change Port Number

  1. Edit <install_dir>/conf/conf-mms.properties:

    mms.centralUrl=http://mms.acmewidgets.com:<newport>
    
  2. Edit <install_dir>/conf/mms.conf

    BASE_PORT=<newport>
    
  3. Restart MMS server:

    sudo <install_dir>/bin/mongodb-mms restart
    

Run as Different User

  1. Edit <install_dir>/conf/mms.conf:

    MMS_USER=foo_user
    
  2. Change Ownership of <install_dir> for new user:

    sudo chown -R foo_user:foo_group <install_dir>
    
  3. Restart MMS server:

    .. code-block:: sh
    

    sudo <install_dir>/bin/mongodb-mms restart

Replication Configuration

The backing MongoDB store uses a connection string URI defined in the <install_dir>/conf/conf-mms.properties directory.

Edit conf-mms.properties to define the replication hosts. For example:

mongo.mongoUri=mongodb://host1:40000,host2:40000,host3:40000/?maxPoolSize=100
mongo.replicaSet=mmsreplset

See Connection String URI Format for more information.

Authentication Configuration

For standalone MongoDB nodes running with user authentication, simply add the username and password credentials to the mongoUri, and specify the database as admin. For example:

mongo.mongoUri=mongodb://mongouser:mongopw@127.0.0.1:40000/admin?maxPoolSize=25
mongo.replicaSet=mmsreplset

Important

You must modify every mongoURI connection string in the conf-mms.properties file.

This does require that you store credentials in plain text; however, following standard practice you may reduce the permissions of the configuration file:

sudo chmod 600 <install_dir>/conf/conf-mms.properties

If you do not want to store credentials in plain text, On Prem MMS Monitoring provides a tool to encrypt the MongoDB credentials. To encrypt authentication credentials:

  1. Navigate to the On Prem MMS Monitoring server installation directory.

  2. Issue the following command to create an encrypted credential pair, replacing <username> with your username:

    bin/credentialstool --username <username> --password
    

    This will prompt you to enter the password and will output the encrypted credential pair.

  3. Copy the encrypted credential pair into the MongoURI connection strings of the conf/conf-mms.properties file where needed, and add the encryptedCredentials = true configuration option to indicate to MMS that the credentials are set as encrypted tokens.

    The added line(s) should resemble the following:

    mongo.encryptedCredentials=true
    

Important

You must modify every mongoURI connection string in the conf-mms.properties file.

Optional: Configure a Required reCaptcha for user Registration

To enable reCaptcha anti-spam test on new user registration, sign up for a reCaptcha account and provide the API credentials in the following two properties:

reCaptcha.public.key=
reCaptcha.private.key=

Optional: Configure Twilio SMS Alert Support

To receive alert notifications via SMS, signup for a Twilio account at http://www.twilio.com/docs/quickstart and enter your account ID, API token, and Twilio phone number into the following properties:

twilio.account.sid=
twilio.auth.token=
twilio.from.num=

Optional: Configure SNMP Heartbeat Support

New in version 1.3.0.

The MIB file is available for download at: http://downloads.mongodb.com/on-prem-monitoring/MMS-MONGODB-MIB.txt

You can configure the On-Prem MMS Server to send a periodic heartbeat trap notification (v2c) that contain an internal health assessment of the MMS Server.

The MMS Server can send traps to one or more endpoints on the standard SNMP UDP port 162.

There are three configuration options that affect the heartbeat behavior:

# Listening UDP port for SNMP. (Note: Setting to less than 1024 will require running MMS server with root privileges.)
snmp.listen.port=11611 #default

# Period in seconds between heartbeat notifications
snmp.default.heartbeat.interval=300 #default

# Optional comma-separated list of hosts where 'heartbeat' traps will be sent on standard UDP port 162.
# Leaving blank (the default) disables the SNMP heartbeat functionality
snmp.default.hosts=

Optional: Configure Advanced MMS User Password Management

New in version 1.3.0.

You can configure the password policy for MMS user accounts with the following properties:

# The number of previous passwords to remember. A remembered password can not be reused.
mms.password.minChangesBeforeReuse=

# The number of failed login attempts before an account becomes locked. An account can only be
# unlocked by an MMS Administrator.
mms.password.maxFailedAttemptsBeforeAccountLock=

# The number of days before an account that has not visisted the MMS website should be locked.
mms.password.maxDaysInactiveBeforeAccountLock=

# The number of days a password can be in use before it must be changed.
mms.password.maxDaysBeforeChangeRequired=

Optional: Configure Advanced MMS User Session Management

New in version 1.3.0.

You can configure the number of hours before a session on the MMS website expires with the following property:

mms.session.maxHours=

Optional: Configure Jetty to use HTTPS Connections

You can configure the Jetty services that run the On-Prem MongoDB Management Service application to use HTTPS. See Configure On-Prem MongoDB Management Service Jetty Instances to use HTTPS for more information.