- Install Ops Manager >
- Test Ops Manager Monitoring
Test Ops Manager Monitoring¶
Overview¶
The following procedure creates a MongoDB replica set and sets up a database populated with random data for use in testing an Ops Manager installation. Create the replica set on a separate machine from Ops Manager.
These instructions create the replica set on a server running RHEL 6+ or Amazon Linux. The procedure installs all the members to one server.
Procedure¶
Increase each server’s default ulimit
settings.¶
If you are installing to RHEL, check whether the
/etc/security/limits.d
directory contains
the 90-nproc.conf
file. If the file exists, remove it. (The
90-nproc.conf
file overrides limits.conf
.) Issue the following
command to remove the file:
For more information, see UNIX ulimit Settings in the MongoDB manual.
Install MongoDB on each server.¶
First, set up a repository definition by issuing the following command:
Second, install MongoDB by issuing the following command:
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.
For example, 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:
The following command sets mongod.mongod
as owner of the new
directories:
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.
For example, the following three commands start three members of a new
replica set named rs0
:
Connect to one of the members.¶
For example, the following command connects to the member running on port 27017
:
Initiate the replica set and add members.¶
In the mongo shell, issue the rs.initiate() and rs.add() methods, as shown in the following example. Replace the hostnames in the example with the hostnames of your servers:
Add data 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.
Confirm data entry.¶
After the script completes, you can view a document in the testData
collection by issuing the following:
To confirm that the script inserted 25,000 documents into the collection, issue the following:
Open the Ops Manager home page in a web browser and register the first user.¶
The first user created for Ops Manager is automatically assigned the Global Owner role.
Enter the following URL in a web browser, where <ip_address>
is the
IP address of the server:
Click the Register link and enter information for the new Global Owner user. When you finish, you are logged into the Ops Manager Application as that user. For more information on creating and managing users, see Manage Ops Manager Users.
Set up monitoring for the replica set.¶
If you have installed the Backup Daemon, click the Get Started button for Backup and follow the instructions. This will set up both monitoring and backup. Otherwise click the Get Started button for Monitoring and follow instructions.
When prompted to add a host, enter the hostname and port of one of the
replica set members in the form <hostname>:<port>
. For example:
mdb.example.net:27018
When you finish the instructions, Ops Manager is running and monitoring the replica set.