How can the 10gen MMS Monitoring agent cartridge be added to a gear?
Environment
- OpenShift Online
Issue
- How can the 10gen MMMS Monitoring agent cartridge for Mongo databases be added to a gear?
- When trying to add the cartridge, the following error is encountered:
$ rhc cartridge add 10gen-mms-agent-0.1 -a example
Adding 10gen-mms-agent-0.1 to application 'example' ... Starting 10gen-mms-agent cartridge
Failed to execute: 'control start' for /var/lib/openshift/5343203ae0b8caac8b000394/10gen-mms-agent
Resolution
- Create a gear with a mongo database or add the mongo database cartridge to an existing gear:
$ rhc app-create AppExample php-5.3 mongodb-2.4
OR
$ rhc cartridge-add mongodb-2.4 -a AppExample
-
Sign up on the MMS website and begin the setup process.
-
At the
Download Agentstep, select theOther Linuxoption. You will be given a command to download a tar archive. Download the tar archive to your local system and note its location. It will be used in a later step:
$ cd /tmp
$ curl -OL https://mms.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent-2.1.x.xx-x.linux_x86_64.tar.gz
- Additionally, you will also be given a MMS api key. Take note of this key, as it will be used in the next step:
mmsApiKey=a4af3221bc1g12c0233a0b624603aef
- Add an environment variable
OPENSHIFT_MMS_API_KEYto your gear with that defines the api key:
$ rhc set-env OPENSHIFT_MMS_API_KEY=a4af3221bc1g12c0233a0b624603aef -a AppExample
- Git clone the application and change into the new directory:
$ rhc git-clone AppExample
$ cd AppExample/
- Create the
mmsdirectory under.openshift. This is where the mms tar archive will be placed:
$ mkdir .openshift/mms
- Move the previously downloaded MMS tar archive into the new mms directory:
$ mv /tmp/mongodb-mms-monitoring-agent-2.1.x.xx-x.linux_x86_64.tar.gz .openshift/mms/
- Add and commit your changes to git, then push the application:
$ git add .openshift/
$ git commit -m "Added MMS tar archive"
$ git push
- Add the 10gen MMS cartridge to the application:
$ rhc cartridge add 10gen-mms-agent-0.1 -a AppExample
Adding 10gen-mms-agent-0.1 to application 'AppExample' ... done
10gen-mms-agent-0.1 (10gen Mongo Monitoring Service Agent)
----------------------------------------------------------
Gears: Located with mongodb-2.4, php-5.3
Monitoring URL: https://mms.mongodb.com/
10gen-mms-agent added.
Please configure your mongodb host at https://mms.mongodb.com/ to start monitoring performance data.
Monitoring URL: https://mms.mongodb.com/
- On the MMS website, verify the agent and continue the setup.
Root Cause
- In the past, the settings.py file from the MMS software had to be added to .openshift/mms after being configured with the api key. However, changes to the MMS software no longer provide the settings.py file. The above is a workaround while major changes are being made.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
