/mongo_opsmanager_lab

Ansible playbooks and Vagrant lab to installa MongoDB OpsManager

Ops Manager bootstrap

Provisions Ops Manager (from scratch or from existing setup) and its agent onboard of nodes.

Full manual at: https://docs.google.com/document/d/1MoAGrNox3NRJu4dUhUhY8jWEUr_UFQ8mHbTGCejMhic/edit?usp=sharing

This repo includes a Vagrant lab for demo purposes:

  • 1 Ops Manager server;
  • 3 machine RS for Ops Manger DB;
  • various machines to build test RS and Shards.

Getting started

Vagrant plugin requirements

  • vagrant-proxyconf allows guests to go to the Internet, necessary in heavily proxied environments.
  • vagrant-hostmanager manages the hosts file on guest machines (reference).
  • vagrant-hostsupdater adds an entry to your /etc/hosts file on the host system.
  • vagrant-scp is nice to copy stuff from/to guests.
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-proxyconf
vagrant plugin install vagrant-scp

Building the lab

Bring up infrastructure:

cd demo_infrastructure
vagrant up # watch out for sudo password requests
cd ..

Run vagrant hostmanager to update guests' hosts files for VMs mutual visibility.

Run vagrant hostsupdater to add hostname mapping in your /etc/hosts before continuing since the local playbooks refer to the hosts by name.

Now configure Ops Manger server and its RS:

cd ansible
sudo ansible-playbook -i mongo.local mongo_ops.yml

Wait for Ops Manager to come up, takes some minutes due to first run schema initializations. You can tail -f /opt/mongodb/mms/logs/*log for updates.

Then, surf to http://opsmanager:8080/, add first user and configure Ops Manager. Refer to official guide.

After the server has been correctly initialized, create a new managed cluster:

  1. Generate API key and take note of mms base url and cluster id.
  2. Fill these info in ansible/mongo_agent.yml.
  3. Run ansible-playbook -i mongo.local mongo_agent.yml

Verify the agents are started on the web UI.