

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

# 建立 ElastiCache 參數群組
<a name="ParameterGroups.Creating"></a>

若您希望修改不同於預設值的一或多個參數值，便需要建立新的參數群組。您可以使用 ElastiCache 主控台、 AWS CLI或 ElastiCache API 建立參數群組。

## 建立 ElastiCache 參數群組 （主控台）
<a name="ParameterGroups.Creating.CON"></a>

下列程序說明如何使用 ElastiCache 主控台建立參數群組。

**使用 ElastiCache 主控台建立參數群組**

1. 登入 AWS 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/elasticache/](https://console.aws.amazon.com/elasticache/) 的 ElastiCache 主控台。

1. 若要查看所有可用參數群組的清單，請從左側的導覽窗格中，選擇 **Parameter Groups (參數群組)**。

1. 若要建立新的參數群組，請選擇 **Create Parameter Group (建立參數群組)**。

   **Create Parameter Group (建立參數群組)** 畫面隨即出現。

1. 從 **Family (系列)** 清單，選擇做為您參數群組範本的參數群組系列。

   參數群組系列，例如 *memcached1.4* 或 *redis3.2，會*定義參數群組中的實際參數及其初始值。參數群組系列必須與叢集的引擎和版本一致。

1. 在 **Name (名稱)** 方塊中，輸入此參數群組的唯一名稱。

   建立叢集或修改叢集的參數群組時，您便會根據其名稱選擇參數群組。因此，我們建議選擇附帶資訊且能以某種方式識別參數群組系列的名稱。

   參數群組命名限制條件如下：
   + 必須以 ASCII 字母開頭。
   + 它只能包含 ASCII 字母、數字和連字符號。
   + 長度必須介於 1 至 255 個字元之間。
   + 不能連續包含兩個連字號。
   + 結尾不能是連字號。

1. 在 **Description (描述)** 方塊中，輸入參數群組的描述。

1. 若要建立參數群組，請選擇 **Create (建立)**。

   若要終止程序而不建立參數群組，請選擇 **Cancel (取消)**。

1. 建立參數群組時，它會擁有系列的預設值。若要變更預設值，您必須修改參數群組。如需詳細資訊，請參閱[修改 ElastiCache 參數群組](ParameterGroups.Modifying.md)。

## 建立 ElastiCache 參數群組 (AWS CLI)
<a name="ParameterGroups.Creating.CLI"></a>

若要使用 建立參數群組 AWS CLI，請使用 命令`create-cache-parameter-group`搭配這些參數。
+ `--cache-parameter-group-name` - 參數群組的名稱。

  參數群組命名限制條件如下：
  + 必須以 ASCII 字母開頭。
  + 它只能包含 ASCII 字母、數字和連字符號。
  + 長度必須介於 1 至 255 個字元之間。
  + 不能連續包含兩個連字號。
  + 結尾不能是連字號。
+ `--cache-parameter-group-family` - 參數群組的引擎和版本系列。
+ `--description` - 使用者提供的參數群組說明。

**Example**  
以下範例會建立名為 *myMem14* 的參數群組，並使用 memcached1.4 系列做為範本。  
若為 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"
    }
}
```

**Example**  
以下範例會建立名為 *myRed28* 的參數群組，並使用 redis2.8 系列做為範本。  
若為 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 參數群組](ParameterGroups.Modifying.md)。

如需詳細資訊，請參閱[https://docs.aws.amazon.com/cli/latest/reference/elasticache/create-cache-parameter-group.html](https://docs.aws.amazon.com/cli/latest/reference/elasticache/create-cache-parameter-group.html)。

## 建立 ElastiCache 參數群組 (ElastiCache API)
<a name="ParameterGroups.Creating.API"></a>

若要使用 ElastiCache API 建立參數群組，請搭配這些參數使用 `CreateCacheParameterGroup` 動作。
+ `ParameterGroupName` - 參數群組的名稱。

  參數群組命名限制條件如下：
  + 必須以 ASCII 字母開頭。
  + 它只能包含 ASCII 字母、數字和連字符號。
  + 長度必須介於 1 至 255 個字元之間。
  + 不能連續包含兩個連字號。
  + 結尾不能是連字號。
+ `CacheParameterGroupFamily` - 參數群組的引擎和版本系列。例如 `memcached1.4`。
+ `CacheParameterGroupFamily` - 參數群組的引擎和版本系列。例如 `redis2.8`。
+ `Description` - 使用者提供的參數群組說明。

**Example**  
以下範例會建立名為 *myMem14* 的參數群組，並使用 memcached1.4 系列做為範本。  

```
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>
```

**Example**  
以下範例會建立名為 *myRed28* 的參數群組，並使用 redis2.8 系列做為範本。  

```
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 參數群組](ParameterGroups.Modifying.md)。

如需詳細資訊，請參閱[https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheParameterGroup.html](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheParameterGroup.html)。