Managing Your MMM Environment

This article discusses different commands you can use to manage your MMM environment. This applies to our Linux Cloud and Dedicated solutions. You can find more information about these solutions at http://www.hosting.com/services/platform-services

Background Information

MMM uses two services to get its job done. The first one, the agent service, is referred to as mmm_agentd. It must be running on all MySQL servers in the MMM environment (Read Only and Master servers). The second one, the monitoring service, is referred to as mmm_mond. It must be running on the monitoring server in your MMM environment (typically this is a Linux VM with not many resources allocated to it).

Common Commands

  1. /etc/init.d/mysql-mmm-monitor  {start|stop|restart|condrestart|status}
    1. This command is used on the monitoring server and is typically used to stop/start/restart the monitoring service
  2. /etc/init.d/mysql-mmm-agent  {start|stop|restart|condrestart|status}
    1. This command is used on the MySQL servers (Masters and Read Only servers). It is typically used to stop/start/restart and check the status of the agent service on the database machines
  3. mmm_control ping
    1. The mmm_control command is used on the monitoring server in the MMM environment. The ping option will tell you if the monitoring service is running properly on it.
  4. mmm_control show
    1. The show command will tell you each host in the MMM environment (excluding the monitoring server) as well as it's type (master/slave) and status (e.g., ONLINE or AWAITING_RECOVERY). It also gives you the role of each node (reader/writer) and the IP assignments that node has currently
  5. mmm_control checks all OR mmm_control checks host_name_here
    1. The monitoring service performs four different types of checks on each host to determine if it is OK. Running this command will tell you the status of each of those checks. These checks look for PING (Is the host reachable?), MySQL (Is MySQL running on the host?), rep_threads (Are replication threads running?), and rep_backlog (Is the replication backlog too big?)
  6. mmm_control set_online host
    1. Brings a host online. Typically this is done after fixing replication on a node that was showing replication issues in the mmm_control checks command's output, or after maintenance on the node is complete
  7. mmm_control set_offline host
    1. Takes a node down for maintenance. This will remove all roles and stop replication.
  8. mmm_control move_role role host
    1. mmm_control move_role writer db2 is an example of this command. This will move the writer role to the db2 host. You may need to do this if explicit change of roles is needed in your environment to meet business needs.