

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon DocumentDB エラスティッククラスターの管理
<a name="elastic-managing"></a>

Amazon DocumentDB Elestic クラスターを管理するには、適切な Amazon DocumentDB コントロールプレーンアクセス許可を持つ IAM ポリシーが必要です。これらのアクセス許可により、クラスターとインスタンスを作成、変更、削除できます。Amazon DocumentDBFullAccess ポリシーは、 Amazon DocumentDB Elastic クラスターを管理するために必要なすべてのアクセス許可を提供します。

以下のトピックでは、Amazon DocumentDB Elastic クラスターを操作するときのさまざまなタスクの実行方法を示します。

**Topics**
+ [Elastic クラスター設定の変更](#elastic-modify)
+ [Elastic クラスターのモニタリング](#elastic-monitor)
+ [Elastic クラスターの削除](#elastic-delete)
+ [Elastic クラスタースナップショットの管理](elastic-manage-snapshots.md)
+ [Amazon DocumentDB Elastic クラスターの停止と開始](elastic-cluster-stop-start.md)
+ [Amazon DocumentDB エラスティッククラスターのメンテナンス](elastic-cluster-maintenance.md)

## Elastic クラスター設定の変更
<a name="elastic-modify"></a>

このセクションでは、 AWS マネジメントコンソール または を使用して Elastic クラスターを変更する方法を、次の手順 AWS CLI で説明します。

クラスターを変更する主な用途は、シャード数やシャードの計算能力を増減してシャードをスケールすることです。

------
#### [ Using the AWS マネジメントコンソール ]

を使用して Elastic クラスターの設定を変更するには AWS マネジメントコンソール:

1. [AWS マネジメントコンソール](https://console.aws.amazon.com/docdb/home?region=us-east-1) にサインインし、Amazon DocumentDB コンソールを開きます。

1. ナビゲーションペインで **[Clusters]** (クラスター) を選択します。
**ヒント**  
画面の左側にナビゲーションペインが表示されない場合は、ナビゲーションペインの左上隅にあるメニューアイコンを選択します。

1. **[クラスター識別子]** 列で、変更するクラスターの名前を選択します。

1. **[Modify]** (変更) を選択します。

1. 変更するフィールドを編集し、**[クラスターの変更]** を選択します。  
![右下隅に [クラスターの変更] ボタンがある、変更できる設定、メンテナンス、認証、およびネットワーク設定オプションを示すフォーム。](http://docs.aws.amazon.com/ja_jp/documentdb/latest/developerguide/images/cluster-shard-modify-3.png)

**注記**  
または、**[クラスター]** ページに移動し、該当するクラスターの横にあるボックスにチェックを入れ、**[アクション]**、**[変更]** の順に選択して **[クラスターの変更]** ダイアログにアクセスします。

------
#### [ Using the AWS CLI ]

を使用して Elastic クラスターの設定を変更するには AWS CLI、以下のパラメータを指定して `update-cluster`オペレーションを使用します。
+ **--cluster-arn** — 必須 変更するクラスターの ARN 識別子。
+ **--shard-capacity** - オプションです。各シャードに割り当てられた vCPU の数。最大数は 64 です。使用できる値は、2、4、8、16、32、64 です。
+ **--shard-count** - オプションです。クラスターに割り当てられたシャードの数。最大数は 32 です。
+ **--shard-instance** 数 — オプション。このクラスター内のすべてのシャードに適用されるレプリカインスタンスの数。最大数は 16 です。
+ **--auth-type** - オプションです。エラスティッククラスターへのアクセスに使用するパスワードの取得先の特定に使用している認証タイプ。有効なタイプは、`PLAIN_TEXT` または `SECRET_ARN` です。
+ **--admin-user-password** - オプションです。 – 管理者ユーザーに関連付けられているパスワード。
+ **--vpc-security-group-ids** - オプションです。このクラスターに関連付ける Amazon EC2 と Amazon 仮想プライベートクラウド (VPC) セキュリティグループのリストを設定します。
+ **--preferred-maintenance-window** - オプションです。週 1 回のシステムメンテナンスを実行できる時間帯 (世界標準時 (UTC))を設定します。

  形式は `ddd:hh24:mi-ddd:hh24:mi` です。有効な曜日 (ddd): 月、火、水、木、金、土、日

  デフォルトは、1 週間のうちのランダムな日に起こる、Amazon Web Services リージョンあたり 8 時間の範囲からランダムに選択された 30 分のウィンドウです。

  最小 30 分のウィンドウ。
+ **--subnet-ids** - オプションです。ネットワークのサブネット ID を設定します。

次の例では、各 {{ユーザー入力プレースホルダー}} を独自の情報に置き換えます。

Linux、macOS、Unix の場合:

```
aws docdb-elastic update-cluster \
    --cluster-arn {{arn:aws:docdb-elastic:us-east-1:477568257630:cluster/b9f1d489-6c3e-4764-bb42-da62ceb7bda2}} \
    --shard-capacity {{8}} \
    --shard-count {{4}} \
    --shard-instance-count {{3}} \
    --admin-user-password {{testPassword}} \
    --vpc-security-group-ids {{ec-65f40350}} \
    --subnet-ids {{subnet-9253c6a3, subnet-9f1b5af9}}
```

Windows の場合:

```
aws docdb-elastic update-cluster ^
    --cluster-arn {{arn:aws:docdb-elastic:us-east-1:477568257630:cluster/b9f1d489-6c3e-4764-bb42-da62ceb7bda2}} ^
    --shard-capacity {{8}} ^
    --shard-count {{4}} ^
    --shard-instance-count {{3}} ^
    --admin-user-password {{testPassword}} ^
    --vpc-security-group-ids {{ec-65f40350}} ^
    --subnet-ids {{subnet-9253c6a3, subnet-9f1b5af9}}
```

------

変更後の Elastic クラスターのステータスをモニタリングするには、「Elastic クラスターのモニタリング」を参照してください。

## Elastic クラスターのモニタリング
<a name="elastic-monitor"></a>

このセクションでは、 AWS マネジメントコンソール または を使用して Elastic クラスターをモニタリングする方法を、次の手順 AWS CLI で説明します。

------
#### [ Using the AWS マネジメントコンソール ]

を使用して Elastic クラスター設定をモニタリングするには AWS マネジメントコンソール:

1. [AWS マネジメントコンソール](https://console.aws.amazon.com/docdb/home?region=us-east-1) にサインインし、Amazon DocumentDB コンソールを開きます。

1. ナビゲーションペインで **[Clusters]** (クラスター) を選択します。
**ヒント**  
画面の左側にナビゲーションペインが表示されない場合は、ナビゲーションペインの左上隅にあるメニューアイコンを選択します。

1. **[クラスター識別子]** 列で、モニタリングするクラスターの名前を選択します。

1. **[モニタリング]** タブを選択します。  
![[モニタリング] タブに表示されるエラスティッククラスターの概要情報。](http://docs.aws.amazon.com/ja_jp/documentdb/latest/developerguide/images/cluster-shard-monitor-2.png)

Amazon CloudWatch からの多くのチャートは、以下のモニタリングカテゴリについて表示されます。
+ リソース使用率
+ スループット
+ オペレーション
+ システム

経由で Amazon CloudWatch にアクセスして AWS マネジメントコンソール 、Elastic クラスター用に独自のモニタリング環境を設定することもできます。

------
#### [ Using the AWS CLI ]

を使用して特定の Elastic クラスター設定をモニタリングするには AWS CLI、以下のパラメータを指定して `get-cluster`オペレーションを使用します。
+ **--cluster-arn** — 必須 情報が必要なクラスターの識別子。

次の例では、各 {{ユーザー入力プレースホルダー}} を独自の情報に置き換えます。

Linux、macOS、Unix の場合:

```
aws docdb-elastic get-cluster \
    --cluster-arn {{arn:aws:docdb-elastic:us-west-2:123456789012:cluster:/68ffcdf8-e3af-40a3-91e4-24736f2dacc9}}
```

Windows の場合:

```
aws docdb-elastic get-cluster ^
    --cluster-arn {{arn:aws:docdb:-elastic:us-west-2:123456789012:cluster:/68ffcdf8-e3af-40a3-91e4-24736f2dacc9}}
```

このオペレーションによる出力は、次のようになります。

```
"cluster": {
        ...
        "clusterArn": "arn:aws:docdb-elastic:us-west-2:123456789012:cluster:/68ffcdf8-e3af-40a3-91e4-24736f2dacc9",
        "clusterEndpoint": "stretch-11-477568257630.us-east-1.docdb-elastic.amazonaws.com",
        "readerEndpoint": "stretch-11-477568257630-ro.us-east-1.docdb-elastic.amazonaws.com",
        "clusterName": "stretch-11",     
        "shardCapacity": 2,
        "shardCount": 3,
        "shardInstanceCount: 5,
        "status": "ACTIVE",
        ...
 }
```

詳細については、「Amazon DocumentDB リソース管理 API リファレンス」の「`DescribeClusterSnapshot`」を参照してください。

を使用してすべての Elastic クラスターの詳細を表示するには AWS CLI、以下のパラメータを指定して `list-clusters`オペレーションを使用します。
+ **--next-token** - オプションです。出力される項目数 (`--max-results`) が基本の API コールによって返される合計項目数より少ない場合、出力には `NextToken` が含まれ、これにより、後続のコマンドを渡して、次の項目のセットを取得できます。
+ **--max-results** - オプションです。コマンドの出力で返される項目の総数。指定された `max-results` の値よりも多くの結果が存在する場合、ページ割りトークン (`next-token`) がレスポンスに含まれるため、残りの結果を取得できます。
  + デフォルト: 100
  + 最小は 20、最大は 100 です

次の例では、各 {{ユーザー入力プレースホルダー}} を独自の情報に置き換えます。

Linux、macOS、Unix の場合:

```
aws docdb-elastic list-clusters \
    --next-token {{eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxfQ==}} \
    --max-results {{2}}
```

Windows の場合:

```
aws docdb-elastic list-clusters ^
    --next-token {{eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxfQ==}} ^
    --max-results {{2}}
```

このオペレーションによる出力は、次のようになります。

```
{
   "Clusters": [
      {
         "ClusterIdentifier":"mycluster-1",
         "ClusterArn":"arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster"
         "Status":"available",
         "ClusterEndpoint":"sample-cluster.sharded-cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com"
       }
       {
         "ClusterIdentifier":"mycluster-2",
         "ClusterArn":"arn:aws:docdb:us-west-2:987654321098:sharded-cluster:sample-cluster"
         "Status":"available",
         "ClusterEndpoint":"sample-cluster2.sharded-cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com"
       }
   ] 
}
```

------

## Elastic クラスターの削除
<a name="elastic-delete"></a>

このセクションでは、 AWS マネジメントコンソール または を使用して Elastic クラスターを削除する方法を、次の手順 AWS CLI で説明します。

------
#### [ Using the AWS マネジメントコンソール ]

 AWS マネジメントコンソールを使用して Elastic クラスター設定を削除するには、以下の手順に従います。

1. [AWS マネジメントコンソール](https://console.aws.amazon.com/docdb/home?region=us-east-1) にサインインし、Amazon DocumentDB コンソールを開きます。

1. ナビゲーションペインで **[Clusters]** (クラスター) を選択します。
**ヒント**  
画面の左側にナビゲーションペインが表示されない場合は、ナビゲーションペインの左上隅にあるメニューアイコンを選択します。

1. クラスターリストの表で、削除するクラスター名の左にあるチェックボックスをオンにし、**[アクション]** を選択します。ドロップダウンメニューから **[削除]** を選択します。

1. **[「cluster-name」の Elastic クラスターを削除しますか?]** ダイアログボックスで **[削除]** を選択します。  
![右下隅に [削除] ボタンがある [削除] ダイアログボックス。](http://docs.aws.amazon.com/ja_jp/documentdb/latest/developerguide/images/cluster-delete-dialog.png)

クラスターが削除されるまでに数分かかります。クラスターのステータスをモニタリングするには、「[Amazon DocumentDB クラスターのステータスのモニタリング](https://docs.aws.amazon.com//documentdb/latest/developerguide/monitoring_docdb-cluster_status.html)」を参照してください。

------
#### [ Using the AWS CLI ]

を使用して Elastic クラスターを削除するには AWS CLI、次のパラメータを指定して `delete-cluster`オペレーションを使用します。
+ **--cluster-arn** — 必須 削除するクラスターの ARN 識別子。
+ **--no-skip-final-backup** - オプションです。最終バックアップを作成する場合は、最終バックアップの名前を指定して、このパラメータを含める必要があります。`--final-backup-identifier` または `--skip-final-backup` のどちらかを含める必要があります。
+ **--skip-final-backup** - オプションです。クラスターを削除する前に最終バックアップを作成しない場合のみ、このパラメータを使用します。デフォルトでは、最終スナップショットを作成します。

次の AWS CLI コード例では、ARN が arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster のクラスターを最終バックアップで削除します。

次の例では、各 {{ユーザー入力プレースホルダー}} を独自の情報に置き換えます。

Linux、macOS、Unix の場合:

```
aws docdb-elastic delete-cluster \
    --cluster-arn {{arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}} \
    --no-skip-final-backup \
    --final-backup-identifier finalArnBU-arn:{{aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}}
```

Windows の場合:

```
aws docdb-elastic delete-cluster ^
    --cluster-arn {{arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}} ^
    --no-skip-final-backup ^
    --final-backup-identifier finalArnBU-arn:{{aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}}
```

次の AWS CLI コード例では、ARN が arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster のクラスターを最終バックアップなしで削除します。

次の例では、各 {{ユーザー入力プレースホルダー}} を独自の情報に置き換えます。

Linux、macOS、Unix の場合:

```
aws docdb-elastic delete-cluster \
    --cluster-arn {{arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}} \
    --skip-final-backup \
```

Windows の場合:

```
aws docdb-elastic delete-cluster ^
    --cluster-arn {{arn:aws:docdb:us-west-2:123456789012:sharded-cluster:sample-cluster}} ^
    --skip-final-backup ^
```

`delete-cluster` オペレーションの出力は、削除するクラスターの表示になります。

クラスターが削除されるまでに数分かかります。クラスターのステータスをモニタリングするには、「[Amazon DocumentDB クラスターのステータスのモニタリング](https://docs.aws.amazon.com/documentdb/latest/developerguide/monitoring_docdb-cluster_status.html)」を参照してください。

------