本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
创建 Valkey 无服务器缓存
在此步骤中,您将在 Amazon ElastiCache 中创建一个新的缓存。
Amazon Web Services Management Console
要使用 ElastiCache 控制台创建新缓存,请执行以下操作:
登录到 Amazon Web Services Management Console 并打开 https://console.aws.amazon.com/connect/
。 在控制台左侧的导航窗格中,选择 Valkey 缓存。
在控制台的右侧,选择创建 Valkey 缓存。
在缓存设置中输入名称。您还可以选择为缓存输入描述。
保持选中默认设置。
单击创建以创建缓存。
缓存处于“活动”状态后,您可以开始在缓存上写入和读取数据。
Amazon CLI
以下 Amazon CLI 示例使用 create-serverless-cache 创建新缓存。
Linux
aws elasticache create-serverless-cache \ --serverless-cache-name CacheName \ --engine valkey
Windows
aws elasticache create-serverless-cache ^ --serverless-cache-name CacheName ^ --engine valkey
请注意,“状态”字段的值设置为 CREATING
。
要验证 ElastiCache 是否已完成缓存创建过程,请使用 describe-serverless-caches
命令。
Linux
aws elasticache describe-serverless-caches --serverless-cache-name CacheName
Windows
aws elasticache describe-serverless-caches --serverless-cache-name CacheName
创建新缓存后,继续执行对缓存读取和写入数据。