View a markdown version of this page

耐久性入門 - Amazon ElastiCache

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

耐久性入門

您可以使用 AWS 管理主控台或 建立耐用的 ElastiCache 叢集 AWS CLI。

使用 AWS 管理主控台

若要開始使用,請在所需 AWS 區域中選取 Valkey 9.0 或更新版本,以建立具有耐用性的新 ElastiCache 叢集。啟用耐用性之後,您可以使用 AWS 主控台,根據您的應用程式需求選擇同步或非同步選項。

如需有關建立叢集的詳細資訊,請參閱 為 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