Switching Over a Blue/Green Deployment

When the green (target) DB system is ready, you can request switchover.

Before switching over, validate the green target DB system. When the switchover request is submitted, the service reevaluates readiness before proceeding. Switchover can interrupt client connections while the service blocks writes on the source DB system and moves the primary endpoint to the target DB system.

Use the Console, a command-line interface, or the REST API to switch over a blue/green deployment.

Using the Console

Switch over a blue/green deployment to make the green target DB system the current DB system.

Do the following to switch over a blue/green deployment:
  1. On the Blue/green deployments list page, select the blue/green deployment that you want to switch over. See Listing Blue/Green Deployments.
    The Blue/green deployment details page appears.
  2. Review the deployment state and switchover status.
    The service performs readiness evaluation again when the switchover request is submitted. If readiness validation does not pass, the switchover request may fail.
  3. Click Switchover.
  4. In the Switchover blue/green deployment panel, review the maintenance impact.
    The green DB system becomes the current DB system. Connections may be briefly interrupted.
  5. Select the Switchover wait time.
    The wait time is the maximum time to wait for remaining replication changes to be applied before switchover. The default is 5 minutes.
  6. Click Switchover.
After a successful switchover, the green target DB system becomes the current DB system for the deployment. The replication channel used for the switchover is automatically deleted. Client applications may need to reconnect after the endpoint handoff. The service does not automatically roll back to the blue source DB system after a successful switchover.

Using the CLI

Use the command-line interface to switch over a blue/green deployment.

This task requires a properly configured CLI installation and the requisite SSH keys. See Command Line Interface.
Before switching over, verify that the target DB system is ready and that your application works with the target DB system.
  1. Check the blue/green deployment status:
    oci mysql blue-green-deployment get 
        --blue-green-deployment-id <BlueGreenDeploymentOCID>
  2. Run the following command:
    oci mysql blue-green-deployment switchover 
        --blue-green-deployment-id <BlueGreenDeploymentOCID>
    --wait-time-in-seconds <NumberOfSeconds>
    • blue-green-deployment-id: Specify the OCID of the blue/green deployment.
    • wait-time-in-seconds: (Optional) Specify the maximum time, in seconds, to wait for remaining replication changes to be applied before switchover. The default is 300 seconds.
After a successful switchover, the green target DB system becomes the current DB system for the deployment. Client applications may need to reconnect after the endpoint hand off. The replication channel used for the switchover is automatically deleted.