[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],null,["# Initiate a manual failover\n\n| **Note:** You can only initiate a manual failover using the gcloud CLI tool.\n\nThis 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.\n\nFor an overview of this feature, see [Manual failover](/memorystore/docs/redis/manual-failover-overview).\n\nInitiating a failover\n---------------------\n\n| **Warning:** Using the `--data-protection-mode=force-data-loss` mode may cause significant data loss. See [Manual failover](/memorystore/docs/redis/manual-failover-overview) to learn the appropriate scenarios for using the `force-data-loss` mode.\n\n1. Open a terminal window\n\n2. Use the `gcloud config` command to set your default project:\n\n\n ```\n gcloud config set core/project PROJECT_ID\n ```\n\n \u003cbr /\u003e\n\n3. Use the following command to initiate a failover:\n\n\n ```\n gcloud redis instances failover INSTANCE_NAME\n ```\n\n \u003cbr /\u003e\n\nOptional data protection mode\n-----------------------------\n\nThe two available data protection modes are:\n\n- `limited-data-loss` mode (default).\n- `force-data-loss` mode.\n\nTo set the data protection mode, use one of the following commands: \n\n gcloud redis instances failover INSTANCE_NAME --data-protection-mode=limited-data-loss\n\nor \n\n gcloud redis instances failover INSTANCE_NAME --data-protection-mode=force-data-loss\n\nHow data protection modes work\n------------------------------\n\nThe `limited-data-loss` mode minimizes data loss by verifying that the\ndifference in data between the primary and replica is below 30 MB before\ninitiating the failover. The offset on the primary is incremented for each byte\nof data that must be synchronized to its replicas. In the `limited-data-loss`\nmode, the failover will abort if the greatest offset delta between the primary\nand each replica is 30MB or greater. If you can tolerate more data loss and want\nto aggressively execute the failover, try setting the data protection mode to\n`force-data-loss`.\n\nThe `force-data-loss` mode employs a chain of failover strategies to\naggressively execute the failover. It does not check the offset delta between\nthe primary and replicas before initiating the failover; you can potentially\nlose more than 30MB of data changes.\n\nSee [Manual failover](/memorystore/docs/redis/manual-failover-overview)\nfor additional information."]]