

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

# Amazon DocumentDB 集群存储配置
<a name="db-cluster-storage-configs"></a>

从 Amazon DocumentDB 5.0 开始，基于实例的集群支持以下两种存储配置类型：
+ **亚马逊 DocumentDB 标准存储**：专为低至中度 I/O 消耗的客户而设计。如果您预计 I/O 成本将低于亚马逊文档数据库集群总量的 25%，那么此选择可能非常适合您。使用 Amazon DocumentDB 标准存储配置，除了实例费用和存储费用外，您还需要 pay-per-request I/O 按比例计费。这意味着您的账单可能会根据周期和使用量有所不同。该配置经过量身定制，可适应您的应用不断变 I/O 化的需求。
+ **Amazon DocumentDB I/O 优化存储**：专为优先考虑价格可预测性或拥有密集型应用程序的客户而设计。 I/O 运I/O-optimized configuration offers improved performance, increased throughput, and reduced latency for customers with I/O intensive workloads. If you expect your I/O costs to exceed 25% of your total Amazon DocumentDB cluster costs, this option offers enhanced price performance. With the Amazon DocumentDB I/O-optimized storage configuration, you won't be charged based on I/O营，确保每个计费周期的成本可预测。该配置可以稳定成本，同时改善性能。

您可以每 30 天将现有数据库集群切换到 Amazon DocumentDB。I/O-optimized storage. You can switch back to Amazon DocumentDB standard storage at any time. The next date to modify the storage configuration to I/O经过优化的可以通过集群配置页面 AWS 管理控制台 中的`describe-db-clusters`命令 AWS CLI 或使用命令进行跟踪。

您可以创建包含 Amazon DocumentDB I/O 优化配置的新数据库集群，也可以通过点击几下[AWS 管理控制台](https://console.aws.amazon.com/docdb/)、在 [AWS Command Line Interface (AWS CLI)](https://aws.amazon.com/cli/) 中更改单个参数或通过以下方式转换现有数据库集群。[AWS SDKs](https://aws.amazon.com/developer/tools/)在修改存储配置期间或修改之后，无需停机或重启实例。

![\[图片：Amazon DocumentDB 标准存储和优化存储差异表。\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/images/io-diagram-1.png)


## 创建 I/O 优化集群
<a name="w2aac35c11c13c15"></a>



------
#### [ Using the AWS 管理控制台 ]

使用 AWS 管理控制台创建或修改 I/O 优化集群：

1. 在 Amazon DocumentDB 管理控制台的**集群**下，选择**创建**或选择集群，再选择**操作**，然后选择**修改**。

1. 如果要创建新的集群，请确保在**集群类型**部分中选择**基于实例的集群**（此为默认选项）。  
![\[图片：含有集群类型选项的控制台屏幕截图。\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/images/create-cluster/cc-type.png)

1. 在**配置**部分的**集群存储配置**下，选择 **Amazon DocumentDB I/O 优化**。  
![\[图片：含有集群存储配置选项的控制台屏幕截图。\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/images/storage-config-1.png)

1. 完成集群的创建或修改，并选择**创建集群**或**修改集群**。

   有关创建集群的完整流程，请参阅 [使用创建集群和主实例 AWS 管理控制台](db-cluster-create.md#db-cluster-create-con)。

   有关修改集群的完整流程，请参阅 [修改 Amazon DocumentDB 集群](db-cluster-modify.md)。

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

使用 AWS CLI创建 I/O 优化集群：

在以下示例中，用您自己的信息替换每个*user input placeholder*示例。

对于 Linux、macOS 或 Unix：

```
aws docdb create-db-cluster \
      --db-cluster-identifier sample-cluster \
      --engine docdb \
      --engine-version 5.0.0 \
      --storage-type iopt1 \
      --deletion-protection \
      --master-username username \
      --master-user-password password
```

对于 Windows：

```
aws docdb create-db-cluster ^
      --db-cluster-identifier sample-cluster ^
      --engine docdb ^
      --engine-version 5.0.0 ^
      --storage-type iopt1 ^
      --deletion-protection ^
      --master-username username ^
      --master-user-password password
```

------

## 确定存储配置的成本分析
<a name="w2aac35c11c13c17"></a>

借助 Amazon DocumentDB，您可以灵活地为自己拥有的每个数据库集群选择存储配置。为了在标准集群和 I/O 优化集群之间正确分配集群，可以按集群跟踪 Amazon DocumentDB 成本。为此，您可以向现有集群添加标签，在 [AWS 账单与成本管理 控制面板](https://aws.amazon.com/pricing/)中启用成本分配标签，并在 [AWS Cost Explorer Service](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/) 中分析给定集群的成本。有关成本分析的信息，请参阅博客“[使用成本分配标签](https://aws.amazon.com/blogs/database/using-cost-allocation-tags-with-amazon-documentdb-with-mongodb-compatibility/)”。