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

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

创建 ElastiCache 参数组

如果存在一个或多个要从默认值更改的参数值,则需要创建新参数组。您可以使用ElastiCache 控制台 Amazon CLI、或 ElastiCache API 创建参数组。

创建 ElastiCache 参数组(控制台)

以下过程介绍了如何使用 ElastiCache 控制台创建参数组。

使用 ElastiCache 控制台创建参数组
  1. 登录 Amazon Web Services Management Console 并打开 ElastiCache 控制台,网址为 https://console.aws.amazon.com/elasticache/

  2. 要查看所有可用的参数组列表,请在导航窗格左侧选择Parameter Groups

  3. 要创建参数组,请选择 Create Parameter Group

    Create Parameter Group(创建参数组)屏幕随即出现。

  4. Family 列表中,选择将作为参数组的模板的参数组系列。

    参数组系列(例如 memcached1.4redis3.2)定义了参数组中的实际参数及其初始值。参数组系列必须与集群的引擎和版本一致。

  5. Name 框中,键入此参数组的唯一名称。

    在创建集群或修改集群的参数组时,您将按参数组的名称选择参数组。因此,建议名称具有信息性,并且以某种方法标识该参数组的系列。

    参数组命名约束如下:

    • 必须以 ASCII 字母开头。

    • 只能包含 ASCII 字母、数字和连字符。

    • 长度必须介于 1 到 255 个字符之间。

    • 不能包含两个连续连字符。

    • 不能以连字符结束。

  6. Description 框中,键入参数组的说明。

  7. 要创建参数组,请选择 Create

    要在不创建参数组的情况下终止此过程,请选择 Cancel

  8. 创建参数组后,它将具有系列的默认值。要更改默认值,您必须修改参数组。有关更多信息,请参阅 修改 ElastiCache 参数组

创建 ElastiCache 参数组 (Amazon CLI)

要使用创建参数组 Amazon CLI,请使用create-cache-parameter-group带有这些参数的命令。

  • --cache-parameter-group-name – 参数组的名称。

    参数组命名约束如下:

    • 必须以 ASCII 字母开头。

    • 只能包含 ASCII 字母、数字和连字符。

    • 长度必须介于 1 到 255 个字符之间。

    • 不能包含两个连续连字符。

    • 不能以连字符结束。

  • --cache-parameter-group-family – 参数组的引擎和版本系列。

  • --description – 用户提供的参数组描述。

以下示例使用 memcached1.4 系列作为模板来创建名为 myMem14 的参数组。

对于 Linux、macOS 或 Unix:

aws elasticache create-cache-parameter-group \ --cache-parameter-group-name myMem14 \ --cache-parameter-group-family memcached1.4 \ --description "My first parameter group"

对于 Windows:

aws elasticache create-cache-parameter-group ^ --cache-parameter-group-name myMem14 ^ --cache-parameter-group-family memcached1.4 ^ --description "My first parameter group"

该命令的输出内容应类似如下所示。

{ "CacheParameterGroup": { "CacheParameterGroupName": "myMem14", "CacheParameterGroupFamily": "memcached1.4", "Description": "My first parameter group" } }

以下示例使用 redis2.8 系列作为模板来创建名为 myRed28 的参数组。

对于 Linux、macOS 或 Unix:

aws elasticache create-cache-parameter-group \ --cache-parameter-group-name myRed28 \ --cache-parameter-group-family redis2.8 \ --description "My first parameter group"

对于 Windows:

aws elasticache create-cache-parameter-group ^ --cache-parameter-group-name myRed28 ^ --cache-parameter-group-family redis2.8 ^ --description "My first parameter group"

该命令的输出内容应类似如下所示。

{ "CacheParameterGroup": { "CacheParameterGroupName": "myRed28", "CacheParameterGroupFamily": "redis2.8", "Description": "My first parameter group" } }

创建参数组后,它将具有系列的默认值。要更改默认值,您必须修改参数组。有关更多信息,请参阅 修改 ElastiCache 参数组

有关更多信息,请参阅 create-cache-parameter-group

创建 ElastiCache 参数组 (ElastiCache API)

要使用 ElastiCache API 创建参数组,请使用带有这些参数的CreateCacheParameterGroup操作。

  • ParameterGroupName – 参数组的名称。

    参数组命名约束如下:

    • 必须以 ASCII 字母开头。

    • 只能包含 ASCII 字母、数字和连字符。

    • 长度必须介于 1 到 255 个字符之间。

    • 不能包含两个连续连字符。

    • 不能以连字符结束。

  • CacheParameterGroupFamily – 参数组的引擎和版本系列。例如,memcached1.4

  • CacheParameterGroupFamily – 参数组的引擎和版本系列。例如,redis2.8

  • Description – 用户提供的参数组描述。

以下示例使用 memcached1.4 系列作为模板来创建名为 myMem14 的参数组。

https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateCacheParameterGroup &CacheParameterGroupFamily=memcached1.4 &CacheParameterGroupName=myMem14 &Description=My%20first%20parameter%20group &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &Version=2015-02-02 &X-Amz-Credential=<credential>

来自此操作的响应应类似如下所示。

<CreateCacheParameterGroupResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/"> <CreateCacheParameterGroupResult> <CacheParameterGroup> <CacheParameterGroupName>myMem14</CacheParameterGroupName> <CacheParameterGroupFamily>memcached1.4</CacheParameterGroupFamily> <Description>My first parameter group</Description> </CacheParameterGroup> </CreateCacheParameterGroupResult> <ResponseMetadata> <RequestId>d8465952-af48-11e0-8d36-859edca6f4b8</RequestId> </ResponseMetadata> </CreateCacheParameterGroupResponse>

以下示例使用 redis2.8 系列作为模板来创建名为 myRed28 的参数组。

https://elasticache.us-west-2.amazonaws.com/ ?Action=CreateCacheParameterGroup &CacheParameterGroupFamily=redis2.8 &CacheParameterGroupName=myRed28 &Description=My%20first%20parameter%20group &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &Version=2015-02-02 &X-Amz-Credential=<credential>

来自此操作的响应应类似如下所示。

<CreateCacheParameterGroupResponse xmlns="http://elasticache.amazonaws.com/doc/2013-06-15/"> <CreateCacheParameterGroupResult> <CacheParameterGroup> <CacheParameterGroupName>myRed28</CacheParameterGroupName> <CacheParameterGroupFamily>redis2.8</CacheParameterGroupFamily> <Description>My first parameter group</Description> </CacheParameterGroup> </CreateCacheParameterGroupResult> <ResponseMetadata> <RequestId>d8465952-af48-11e0-8d36-859edca6f4b8</RequestId> </ResponseMetadata> </CreateCacheParameterGroupResponse>

创建参数组后,它将具有系列的默认值。要更改默认值,您必须修改参数组。有关更多信息,请参阅 修改 ElastiCache 参数组

有关更多信息,请参阅 CreateCacheParameterGroup