Running mysql-diag

Warning: MySQL for PCF v1.10 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.

This topic discusses how to use the mysql-diag tool in MySQL for Pivotal Cloud Foundry (PCF). mysql-diag relays the state of your MySQL service and suggests steps to take in the event of a node failure. In conjunction with Pivotal Support, this tool helps expedite the diagnosis and resolution of problems with MySQL for PCF.

In MySQL for PCF v1.9.0 and later, the mysql-diag tool is automatically installed and configured. If you are on a prior version, select the documentation for your version of MySQL for PCF.

Run mysql-diag

The commands that you use to run mysql-diag depend on which version of PCF you have.

Run mysql-diag Using BOSH CLI v1

If you are using PCF v1.10, follow the procedure below. If you are using PCF v1.11 or later, see Run mysql-diag Using BOSH CLI v2.

  1. If this is your first time using mysql-diag, follow the instructions within the Prepare to Use the BOSH CLI topic. If you have completed this step in a prior use of mysql-diag, move directly to Step 2.

  2. Select Pivotal Application Service (PAS), Elastic Runtime, or MySQL for PCF as your deployment to troubleshoot. Perform the steps detailed in Select a Product Deployment to Troubleshoot.

  3. Run bosh ssh from the Ops Manager VM and select the mysql-monitor node from the list.

  4. From the mysql-monitor VM, run mysql-diag:

    $ mysql-diag

Run mysql-diag Using BOSH CLI v2

If you are using PCF v1.11 or later, follow the procedure below. If you are using PCF v1.10, see Run mysql-diag Using BOSH CLI v1.

  1. If this is your first time using mysql-diag, follow the instructions in Prepare to Use the BOSH CLI topic. If you have completed this step in a prior use of mysql-diag, move directly to Step 2.
  2. Run bosh2 -e MY-ENV -d MY-DEP ssh from the Ops Manager VM and select the mysql-monitor node from the list.

mysql-diag-agent

MySQL for PCF v1.9.0 and later has the mysql-diag-agent. Older versions of MySQL for PCF do not have the mysql-diag-agent. If the mysql-diag-agent is not available, your output from the mysql-diag tool will not include the percentage of Persistent and Ephemeral Disk space used by a Host.

Example Healthy Output

The mysql-diag command returns the following message if your canary status is healthy:

Checking canary status...healthy

Here is a sample mysql-diag output after the tool identified a healthy cluster:

Mysql diag healthy screen shot View a larger version of this image.

Example Unhealthy Output

The mysql-diag command returns the following message if your canary status is unhealthy:

Checking canary status...unhealthy

In the event of a broken cluster, running mysql-diag outputs actionable steps meant to expedite the recovery of that cluster. Below is a sample mysql-diag output after the tool identified an unhealthy cluster:

Mysql diag unhealthy screen shot View a larger version of this image.