跳至内容

Cluster Mode Enabled Redis with 2 shards and no replicas fails due to auto failover turned off

0

Description:

While creating an ElastiCache Redis (cluster mode enabled) replication group via CloudFormation with this configuration:

AutomaticFailoverEnabled: false
NumNodeGroups: 2           # 2 shards
ReplicasPerNodeGroup: 0    # no replicas

I receive the following error:

Redis with cluster mode enabled cannot be created with auto failover turned off

Expected behavior: According to AWS documentation, it should be possible to create a cluster-mode-enabled Redis setup with zero replicas, e.g., “90 shards and 0 replicas”. I expected AWS to allow at least a minimal “primary-only” CME deployment for cost-effective or testing purposes.

Actual behavior: CloudFormation (and the ElastiCache API) enforce that for cluster-mode-enabled, AutomaticFailoverEnabled must be true and at least one replica per shard is required. Otherwise, the creation is blocked with the error shown above.

Redis with cluster mode enabled cannot be created with auto failover turned off. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterValue; )

Questions The documentation’s description and the actual behavior are inconsistent. So, can I use cluster mode enabled with multiple shards but zero replicas and disable auto‑failover? If the answer is ‘no’, please update the relevant documentation to avoid misleading users.

Thanks so much.

已提问 1 年前320 查看次数

1 回答
1

The inconsistency you're experiencing is due to a specific constraint with ElastiCache for Redis (cluster mode enabled): you cannot create a cluster mode enabled setup with auto-failover disabled.

While the documentation mentions that you can have "90 shards and 0 replicas" in a cluster mode enabled configuration, there's an important distinction to make. For Valkey or Redis OSS (cluster mode enabled), you can technically have zero replicas per shard, but automatic failover must still be enabled.

The reason for this requirement is that cluster mode enabled is designed with high availability in mind. Even though you can configure it with zero replicas, the automatic failover feature must be enabled as part of the cluster mode enabled architecture. Without replicas, you won't actually be able to failover to a replica if your primary node fails, but the setting must still be enabled.

For your specific use case, if you want to create a cost-effective or testing environment with cluster mode enabled, you must:

  1. Set AutomaticFailoverEnabled to true
  2. You can keep ReplicasPerNodeGroup at 0
  3. Maintain your NumNodeGroups at 2 or whatever number of shards you need

This configuration will allow you to create a cluster mode enabled setup with multiple shards and no replicas, though you should be aware that without replicas, you won't have failover capability despite the setting being enabled.
Sources
Valkey or Redis OSS nodes and shards - Amazon ElastiCache
CreateReplicationGroup - Amazon ElastiCache
ConfigureShard - Amazon ElastiCache

已回答 1 年前

AWS
专家

已审核 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。