LATEST VERSION: 1.10 - CHANGELOG
Pivotal Cloud Foundry v1.9

Scaling Down Your MySQL Cluster

This topic describes how to safely scale down your MySQL cluster to a single node.

By default MySQL is a single node. To take advantage of the high availability features of MySQL, you may have scaled the configuration up to three nodes.

Note: If you are only running the MySQL cluster with a single node, you do not need to perform these steps.

Check the Health of Your Cluster

Before scaling down your MySQL cluster, perform the following actions to ensure the cluster is healthy.

  1. Use the cf CLI to target the API endpoint of your Pivotal Cloud Foundry (PCF) deployment:

    $ cf api api.YOUR-SYSTEM-DOMAIN
    Setting api endpoint to api.YOUR-SYSTEM-DOMAIN...
    OK

    API endpoint: https://api.YOUR-SYSTEM-DOMAIN... (API version: 2.54.0) Not logged in. Use 'cf login' to log in.

  2. Log in with your User Account and Authentication (UAA) Administrator user credentials. Obtain these credentials by clicking the Credentials tab of the Elastic Runtime tile, locating the Admin Credentials entry in the UAA section, and clicking Link to Credential.

    $ cf login -u admin
    API endpoint: https://api.YOUR-SYSTEM-DOMAIN

    Password> Authenticating... OK

  3. Create a test organization to verify the database across all nodes:

    $ cf create-org validation-testing
    Creating org validation-testing as admin...
    OK

    Assigning role OrgManager to user admin in org validation-testing ... OK

    TIP: Use 'cf target -o validation-testing' to target new org

  4. Obtain the IP addresses of your MySQL server by performing the following steps:

    1. From the PCF Installation Dashboard, click the Pivotal Elastic Runtime tile.
    2. Click the Status tab.
    3. Record the IP addresses for all instances of the MySQL Server job.
  5. Obtain the CCDB credentials for your MySQL server by performing the following steps:

    1. From the Elastic Runtime tile, click the Credentials tab.
    2. Locate the Ccdb Credentials entry in the MySQL Server section and click Link to Credential.
    3. Record the values for identity and password.
  6. SSH into the Ops Manager VM. Because the procedures vary by IaaS, review the SSH into Ops Manager section of the Advanced Troubleshooting with the BOSH CLI topic for specific instructions.

  7. For each of the MySQL server IP addresses recorded above, perform the following steps from the Ops Manager VM:

    1. Query the new organization with the following command, replacing YOUR-IP with the IP address of the MySQL server and YOUR-IDENTITY with the identity value of the CCDB credentials obtained above:
      $ mysql -h YOUR-IP -u YOUR-IDENTITY -D ccdb -p -e "select created_at, name from organizations where name = 'data-integrity-test-organization'"
      
    2. When prompted, provide the password value of the CCDB credentials obtained above.
    3. Examine the output of the mysql command and verify the created_at date is recent.
      +---------------------+----------------------------------+
      | created_at          | name                             |
      +---------------------+----------------------------------+
      | 2016-05-28 01:11:42 | data-integrity-test-organization |
      +---------------------+----------------------------------+
      
  8. If each MySQL server instance does not return the same created_at result, contact Pivotal Support before proceeding further or making any changes to your deployment. If each MySQL server instance does return the same result, then you can safely proceed to scaling down your cluster to a single node by performing the steps in the following section.

Scale Down Your Cluster

  1. From the PCF Installation Dashboard, click the Pivotal Elastic Runtime tile.
  2. Select Resource Config.
  3. Use the drop-down menu to change the Instances count for MySQL Server to 1.
  4. Click Save to apply the changes.
  5. Delete your test organization with the following cf CLI command:
    $ cf delete-org data-integrity-test-organization
Create a pull request or raise an issue on the source for this page in GitHub