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.
- 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.
- 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
- 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.
- Create a new PV to hold the mysql database.
- Mount that new PV to the same deployment that you mounted the old PV to.
- 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".
- Unmount the old PV on the crashing pod.
- Mount the new SQL pod on same path the old one was originally mounted.
- Unmount the PV's from whatever stable deployment you had mounted them to.