MongoDB Ops Manager is a service for managing, monitoring and backing up a MongoDB infrastructure. In addition, Ops Manager allows Administrators to maintain a server pool to facilitate the deployment of MongoDB. Ops Manager provides the services described below.
Ops Manager Monitoring provides real-time reporting, visualization, and alerting on key database and hardware indicators. How it Works: A lightweight Monitoring Agent runs within your infrastructure and collects statistics from the nodes in your MongoDB deployment. The agent transmits database statistics back to Ops Manager to provide real-time reporting. You can set alerts on indicators you choose.
Ops Manager Automation provides an interface for configuring MongoDB nodes and clusters and for upgrading your MongoDB deployment.
Ops Manager Backup provides scheduled snapshots and point-in-time recovery of your MongoDB replica sets and sharded clusters.
Automation Agents on each MongoDB host maintain your deployments. You can install the Automation Agent so it can provision hosts and deploy clusters in your MongoDB infrastructure.
The Automation Agent also maintains the Monitoring and Backup Agents and starts, restarts, and upgrades the agents as needed.
Automation allows only one Monitoring or Backup Agent per host. It removes additional agents.
Ops Manager Architecture
Open Ops Manager’s default ports and health-check endpoints refer the link below
Ops Manager Application
The Ops Manager Application provides the user interface and the HTTP services the Agents use to transmit data to and from Ops Manager. These are all stateless and start automatically when the Ops Manager Application starts. Multiple instances of the Ops Manager Application can run if each instance uses the same configuration and application database. Users and agents can interact with any instance.
By default, the Ops Manager Application runs on port 8080 and contains the web interface for managing Ops Manager users, monitoring of MongoDB hosts, and managing host backups.
Backup Daemon Service
We can configure any Ops Manager instance to run the Backup Daemon service to back up MongoDB databases. The Backup Daemon service manages the local copies of the backed-up databases and snapshots for each database. The daemon does scheduled work based on data coming into the Ops Manager from its Backup Agents. No client applications can talk directly to the daemon. Its state and job queues come from the Ops Manager Application Database. The local backup copy of a deployment is called the head database. The Backup Daemon stores all its head databases in its head directory path. To create each head database, the daemon’s host acts as an “invisible” secondary for each replica set designated for backup.
The daemon takes scheduled snapshots and stores these snapshots in a snapshot store. The daemon retrieves data from the snapshot store when it receives a restore request. It then delivers the snapshot to the requested destination.
Ops Manager uses a dedicated MongoDB database to store the Ops Manager’s operational data. The application database runs as a replica set to ensure redundancy and high availability. This replica set hosts only Ops Manager data. Before installing Ops Manager, you must provision the application database. This database contains Ops Manager Application metadata:
- Monitoring data collected from Monitoring Agents.
- Metadata for Ops Manager users, projects, hosts, monitoring data, and backup state.
For best performance on any of these installs, configure each backup host with two disk partitions: one for the snapshot store or File System Store and one for the head databases.
This deployment provides redundancy for the Ops Manager Application Database and Snapshot Storage in the event of host failure. The deployment runs the database in a MongoDB replica set with three data-bearing members with copies of the data.
If we want to serve both the Ops Manager application and a Backup Daemon on one host. This Ops Manager configuration will manage and monitor 300 MongoDB hosts and back up 200 hosts. The total disk capacity of all databases being backed up is 4 TB. The total requirements would be:
- Ops Manager application needs 15 GB of RAM.
- The Backup Daemon also needs:
15 GB of RAM and
2.5 times the 4 TB of backed up databases in disk capacity.
This example host would require a minimum of 30 GB of RAM and 10 TB of disk capacity.
Ulimits Requirements for Ops Manager Application
RHEL and CentOS 6 limit the maximum number of user processes to 1024. This overrides the general user process limit (ulimit -u) setting.
For the userid that runs Ops Manager (mongodb-mms by default), add soft and hard nproc (number of processes) entries to the /etc/security/limits.d/99-mongodb-nproc.conf user process configuration file. Use values that are larger than the RHEL 1024 user process limit.
mongodb-mms soft nproc 200000 mongodb-mms hard nproc 500000
Provision an Ops Manager host
System Memory : 15 GB
Disk Capacity : 50 GB in /
Host OS Permissions : root
Install the Ops Manager Application Database and Backup Database
These databases run on dedicated MongoDB replica sets. If you use multiple backup databases, you must configure one replica set for each backup database. The replica set for each database must be dedicated to that database only and must store no other data.
The backing databases must run on independent replica sets on independent storage volumes. Running regular backups, a backup database could fill a volume. If the application database cannot write to a volume, Ops Manager stops. Proper storage setup reduces the risk of Ops Manager failures.
To configure the replicaset instance click here
Replica Set Security
- Secure the Connection to the Backing Databases
- Configure these databases to accept connections from Ops Manager that only use SSL.
- Configure an Authentication Mechanism for the Backing Databases
- Configure the Ops Manager User that Accesses the Backing Databases with Only needed roles
Configure yum to install MongoDB
OS used in this example is Amazon Linux AMI
Create a /etc/yum.repos.d/mongodb-org-4.0.repo file
[mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
Install MongoDB packages
sudo yum install -y mongodb-org
Create the Ops Manager Application Database directory
sudo mkdir -p /data/appdb sudo chown -R mongod:mongod /data
Create the Ops Manager backup data directory
sudo mkdir -p /data/backup sudo chown mongod:mongod /data/backup
Start the Ops Manager Application Database mongod instance.
sudo -u mongod mongod --port 27017 --dbpath /data/appdb \ --logpath /data/appdb/mongodb.log \ --wiredTigerCacheSizeGB 1 --fork
Note : For high availability configure replicaset for application and backup database instance.
Download the Ops Manager package.
- Download the Ops Manager rpm package from MongoDB Download Center
- From the Platforms drop-down menu, click Red Hat + CentOS 6, 7 / SUSE 12 / Amazon Linux.
- From the Packages drop-down menu, click RPM and click Download
Download the latest stable release from link below
Install Ops Manager
Install the .rpm package by issuing the following command
sudo rpm -ivh mongodb-mms-188.8.131.52517.20190605T1533Z-1.x86_64.rpm
The install creates the following:
The base directory for the Ops Manager software, which is:
A new system user,
mongodb-mms, under which the host runs.
/opt/mongodb/mms/conf/conf-mms.propertiesfile, which contains the connection string to access the Application Database. The default is
27017, so no changes are necessary.
Configure the Ops Manager connection to the Ops Manager Application Database.
On a server that is to run the Ops Manager, open /opt/mongodb/mms/conf/conf-mms.properties with root privileges and configure the settings described here, as appropriate.
Configure the following setting to provide the connection string Ops Manager uses to connect to the database:
If you will configure Ops Manager to use the Ops Manager Application Database over SSL, configure the following SSL settings.
Ops Manager also uses these settings for SSL connections to Backup Databases
If you will configure Ops Manager to use Kerberos to manage access to the Ops Manager Application Database, configure the following Kerberos settings:
Start Ops Manager
sudo service mongodb-mms start
Open the Ops Manager home page and register the first user
Enter the following URL in a browser, where <host> is the fully qualified domain name of the server:
Access to the OPS Manager application
Register the first user
Once your account have been created, configure the OPS Manager access URL.
Then configure your email settings.
Click on Continue and configure the User Authentication, Backup Snapshots, Proxy.
Finish by the OPS Manager versions configuration.
Please find the ops manager application configuration settings in link below