View a markdown version of this page

耐久性入门 - Amazon ElastiCache
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

耐久性入门

您可以使用 Amazon 管理控制台或创建持久 ElastiCache 集群 Amazon CLI。

使用 Amazon 管理控制台

首先,请在所需 Amazon 区域选择 Valkey 9.0 或更高版本来创建一个具有持久性的新 ElastiCache 集群。启用耐久性后,您可以使用 Amazon 控制台根据应用程序要求选择同步或异步选项。

有关创建集群的更多信息,请参阅创建 Valkey 或 Redis OSS 集群

使用 CLI

要创建具有同步写入功能的新持久集群,请执行以下操作:

aws elasticache create-replication-group \ --replication-group-id my-durable-cluster \ --replication-group-description "ElastiCache durable cluster" \ --engine valkey --engine-version 9.0 \ --num-node-groups 2 --replicas-per-node-group 1 \ --cache-node-type cache.r7g.large \ --multi-az-enabled \ --transit-encryption-enabled \ --durability sync \ --region us-east-1

要创建具有异步写入功能的集群,请设置--durability async

aws elasticache create-replication-group \ --replication-group-id my-durable-cluster \ --replication-group-description "ElastiCache durable cluster" \ --engine valkey --engine-version 9.0 \ --num-node-groups 2 --replicas-per-node-group 1 \ --cache-node-type cache.r7g.large \ --multi-az-enabled \ --transit-encryption-enabled \ --durability async \ --region us-east-1

要在同步写入和异步写入之间切换现有集群,请使用modify-replication-group

aws elasticache modify-replication-group \ --replication-group-id my-durable-cluster \ --durability async