Initiating a manual failover

This page describes how to initiate a manual failover for a standard tier Cloud 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

  1. Open a terminal window

  2. Use the gcloud config command to set your default project:

    gcloud config set core/project PROJECT_ID
    

  3. 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:

  • limited-data-loss mode (default).
    • Manual failover always runs in limited-data-loss mode, unless you change the mode.
  • force-data-loss 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

or

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 master to the replica 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 master and replica is below 30MB before initiating the failover.

The force-data-loss mode overrides this check on master-replica synchronization. If you use the force-data-loss mode when the replica synchronization is more than 30 MB behind the master, you could lose 30 MB of data or more.

See Manual failover for additional information.

Kunde den här sidan hjälpa dig? Berätta:

Skicka feedback om ...

Google Cloud Memorystore for Redis