[[["容易理解","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,["# High availability for Memorystore for Redis\n\n| **Note:** If you are looking for the Memorystore for Redis Cluster documentation, see [High availability and replicas](/memorystore/docs/cluster/ha-and-replicas).\n\nThis page describes High Availability (HA) for Memorystore for Redis instances in\nthe Standard Tier.\n\nOverview\n--------\n\nThe Standard Tier protects a Redis instances from common failures by replicating\ndata to one or more replicas, and by providing fast automatic failover to a\nreplica.\n\nThe Standard Tier is provisioned with one primary and one or more replicas. A\nStandard Tier instance that has the `readReplicaMode` disabled has\na single non-read replica. A Standard Tier instance that has the\n`readReplicaMode` enabled has one to five read replicas. To determine if\nthe `readReplicaMode` is enabled, see [Viewing read replica information](/memorystore/docs/redis/managing-read-replicas#viewing_read_replica_information_for_your_instance).\n\nMemorystore for Redis provides high availability by replicating a Redis primary\nto one or more replicas. Changes made to the data on the primary are copied to\nreplicas using the [Redis asynchronous replication protocol](http://redis.io/topics/replication). Due to the asynchronous nature of replication, replicas can lag behind the\nprimary depending on the write rate on the primary.\n\nOn failure of the primary, the instance fails over automatically to a replica.\nFor instances configured with more than one replica, the instance automatically\nfails over to a replica with the least replication lag that is healthy.\n\nIf an instance is configured with only one non-read replica, all application\nconnections are directed to the primary endpoint. If an instance is\nconfigured using read replicas, applications can also leverage the read endpoint\nto distribute read queries across all replicas.\n\nWhen a failover is triggered\n----------------------------\n\nA failover occurs when the Redis primary fails. During a failover, the\nprimary and read endpoint automatically redirect to the new primary and\nreplicas. All connections to the primary endpoint are dropped and read endpoint\nconnections to the read replica that is promoted are also dropped.\n\nHow a failover affects your application\n---------------------------------------\n\nWhen the primary fails over to the replica, existing connections to the\nprimary endpoint of the instance are dropped. The instance will be unavailable\nfor an average of 30 seconds during automated repairs, and 15 seconds for\nmaintenance events. On reconnect, your application is automatically redirected\nto the new primary using the same connection string or IP address. You don't\nneed to update your application after a failover.\n\nDuring failover, if there are connections to the read endpoint, the connections\nto the replica that is being promoted to primary are dropped. The connections to\nthe other replicas continue to be served during the failover. Once the failover\nis complete and the new replica is available, connections are redirected to the\nnew replica.\n| **Note:** Due to the asynchronous nature of Redis's replication protocol, acknowledged writes may be lost during a failover. Your applications must be able to tolerate losing acknowledged writes.\n\nRetrying the instance connection after failover\n-----------------------------------------------\n\nWhen a failover happens, all connections from the primary endpoint are dropped\nand depending on the number of replicas some read connections are terminated.\n\nDue to this loss of connection, your application needs to retry in order to\nreestablish the connection. The retry logic should use exponential backoff to\nensure that you don't overload your instance with too many retry requests. In\naddition to including retry logic, you should test how a failover affects your\napplication by [testing with a manual failover](/memorystore/docs/redis/manual-failover-overview).\n| **Note:** The manual failover API is not supported for instances that have read replicas enabled.\n\nMost Redis clients have built-in retry capabilities that you should leverage in\nthe event of a connection drop due to failover.\n\nA failover occurs in the following scenarios:\n\n- [Scaling your instance](/memorystore/docs/redis/scaling-instances)\n- [Upgrading the Redis version of an instance](/memorystore/docs/redis/upgrading-instance-version)\n- [Initiating a manual failover](/memorystore/docs/redis/initiating-manual-failover)\n- [Maintenance updates](/memorystore/docs/redis/maintenance-policy)\n\nIf you implement retry logic in your application to handle connection drops due\nto failovers, your instance should not see a significant performance impact.\nUsually, issues only arise as a result of not having retry logic in place.\n\nHow you view the status for high availability\n---------------------------------------------\n\nYou can see high availability metrics for your Redis instance by using\nCloud Monitoring. For information about the metrics that Cloud Monitoring\nprovides for Memorystore for Redis, see [Monitoring Redis Instances](/memorystore/docs/redis/monitoring-instances)\nand [Monitoring metrics](/memorystore/docs/redis/monitoring-metrics).\n\nFor more information,\nsee the [Cloud Monitoring documentation](/monitoring/docs).\n\nTo see the native replication status that Redis provides, you can [issue the Redis INFO command](https://redis.io/commands/INFO)\nto the Memorystore for Redis instance."]]