Skip to Content
Google Cloud Platform for Developers
book

Google Cloud Platform for Developers

by Ted Hunter, Steven Porter
July 2018
Intermediate to advanced
506 pages
16h 2m
English
Packt Publishing
Content preview from Google Cloud Platform for Developers

Forcing a failover

In addition to automatic failover, Cloud SQL supports user-initiated failover. This is useful for testing how applications will handle failover in non-production environments, and can be used should Cloud SQL fail to identify issues with the master instance. Let's try this out on our hello-cloud-sql instance. First, enable high availability for the instance with the following command:

gcloud beta sql instances patch hello-cloud-sql \   --availability-type REGIONAL

This operation will take some time to complete as the replica is created and all data is replicated between instances. Once finished, execute the following command to see which zone is currently serving data:

gcloud sql instances describe hello-cloud-sql --format="value(gceZone)" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Cloud Platform in Action

Google Cloud Platform in Action

John J. (JJ) Geewax
Google Cloud Platform for Architects

Google Cloud Platform for Architects

Vitthal Srinivasan, Loonycorn Ravi, Judy Raj

Publisher Resources

ISBN: 9781788837675Supplemental Content