Skip to content

Instantly share code, notes, and snippets.

@jhjguxin
Created June 25, 2013 06:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhjguxin/5856483 to your computer and use it in GitHub Desktop.
Save jhjguxin/5856483 to your computer and use it in GitHub Desktop.
MongoDB Monitoring Service(MMS) Tutorial

MongoDB Monitoring Service Tutorial

To begin using the MongoDB Monitoring Service:

Once you have set up the MongoDB Monitoring Service, you can:

Install the MMS Agent on UNIX/Linux

Requirements and Prerequisites

MMS has a series of prerequisite requirements. The following sections will guide you through the requirements and provide basic instructions for fulfilling them.

Basic MMS Requirements
  • Your MongoDB instances (i.e. mongod and mongos) must be

  • version 1.6 or newer.

  • You must have Python 2.4 or greater.

    Note The MMS Agent does not provide support the PyPy implementation of Python.
    The MMS Agent does not support the Python 3.x series of Python.
  • You’ll need Python’s setuptools.

    Most operating systems (i.e. distributions) package setuptools. For example, Debian and Ubuntu users can use the following command to install the package:

    sudo apt-get install python-setuptools
    

    For Red Hat Enterprise Linux (RHEL) CentOS, or Fedora users, the the following command will install the package:

    sudo yum install python-setuptools
    
  • If your system is running Python 2.4, you will need to install the

    following Python modules:

    • hmac
    • hashlib

    Issue the following command:

    Modules/shamodule.c:18:20: error: Python.h: No such file or directory

    sudo yum install python-devel sudo easy_install hmac hashlib

    Note The latest version of the agent includes no other Python module dependencies. If you’re installing version 1.4 of the agent (legacy) you will also need to install the simplejson module.

    sudo easy_install simplejson==2.1.0
    

    For users of Python 2.4, you will need to install simplejson version 2.1.0. Install this module with the following command:

    sudo easy_install simplejson
    

    Do not use pip to install modules when using Python 2.4 or 2.5, as there are some compatibility issues. Some users have reported problems installing hmac, if easy_install produces an error or you suspect a problem with these libraries see instructions for installing hmac manually.

  • All users must install PyMongo, the Python driver for MongoDB.

    Use the latest possible version of PyMongo for the best possible speed and stability. The agent is not compatible with versions of PyMongo before 1.9. For instructions for installing PyMongo, see Installing PyMongo.

  • If your datacenter requires that you proxy outbound connections through a gateway, you must use a version of Python greater than 2.6.1. Additionally, you will need export the "https_proxy" environment variable (or “HTTPS_PROXY” on Windows). For more information, see "Working with Proxies".

Install PyMongo

While the C extensions are not required for MMS, they significantly improve performance. To install these extensions, make sure you have a C compiler (e.g. gcc) and Python header files installed on your system. Debian and Ubuntu users should issue the following command:

sudo apt-get install build-essential python-dev

Red Hat, CentOS, and Fedora Users should issue the following command:

sudo yum install gcc python-devel

If you have not installed pymongo issue the following command to install the latest version:

sudo easy_install pymongo

To upgrade to the latest version of the driver, use the following command:

sudo easy_install -U pymongo

For more information concerning PyMongo installation, see the PyMongo documentation.

wget https://mms.10gen.com/settings/mmsAgent/cda56c4f5481b1bc66489559464dcb45/10gen-mms-agent-guanxi.me.zip.
sudo yum install unzip
unzip 10gen-mms-agent-guanxi.me.zip -d 10gen-mms-agent-guanxi.me && cd 10gen-mms-agent-guanxi.me/mms-agent
sudo bash -c "nohup python agent.py > /var/log/mms-agent.log 2>1 &"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment