This page describes how to initiate a manual failover for a standard tier Memorystore for Redis instance. The manual failover feature allows you to test how normal failovers affect your application.
For an overview of this feature, see Manual failover.
Initiating a failover
Open a terminal window
gcloud configcommand to set your default project:
gcloud config set core/project PROJECT_ID
Use the following command to initiate a failover:
gcloud redis instances failover INSTANCE_NAME
Optional data protection mode
The two available data protection modes are:
- Manual failover always runs in limited-data-loss mode, unless you change the mode.
To change the data protection mode, use one of the following commands:
gcloud redis instances failover INSTANCE_NAME --data-protection-mode=force-data-loss
gcloud redis instances failover INSTANCE_NAME --data-protection-mode=limited-data-loss
How data protection modes work
If you want to test how your application will behave in a real failover scenario, you can use the
force-data-loss mode because it most accurately represents the conditions of a failover in disaster recovery.
Any failover from the primary node to the replica node risks some data loss. The
limited-data-loss mode keeps that data loss to a minimum by verifying that the difference in synchronization between your primary node and replica node is below 30MB before initiating the failover.
force-data-loss mode overrides this check on primary-replica synchronization. If you use the
force-data-loss mode when the replica synchronization is more than 30 MB behind the primary, you could lose 30 MB of data or more.
See Manual failover for additional information.