Migrating a mysql pod to a larger PV

CloudApps Version 4.0

Please read the following documentation: Carolina CloudApps: Increasing the size of a Persistent Volume.

CloudApps Version 3.0

The most common cause of a database pod crash-looping is running out of space on the PV. This guide will tell you how to solve that.

  1. Look at the deployment configuration (in CloudApps) for the mysql pod which is crash looping. You can reach the configuration screen by clicking on the crashing pod on the Cloudapps overview page.
  2. Under Template / Containers find where the mysql data is mounted. Make a note of this. Ex: Mount: hunger-prod-data, subpath mysql → /var/lib/mysql/data read-write
  3. Mount that PV to a stable deployment. What deployment doesn't really matter, but you probably shouldn't use something like the main SOG deployment.
  4. Create a new PV to hold the mysql database.
  5. Mount that new PV to the same deployment that you mounted the old PV to.
  6. Copy the contents of the mysql folder on the old PV to the new PV. If you mounted one to /mysql and the new one to mysql2, you would do something like "cp mysql mysql2".
  7. Unmount the old PV on the crashing pod.
  8. Mount the new SQL pod on same path the old one was originally mounted.
  9. Unmount the PV's from whatever stable deployment you had mounted them to.