【问题标题】:How do I provision throughput on a container?如何在容器上配置吞吐量?
【发布时间】:2019-10-15 11:10:11
【问题描述】:

我使用this ARM 模板创建了一个 Cosmos Db 帐户、数据库和容器。通过 Azure DevOps 发布管道进行部署。

我使用this ARM 模板来调整数据库吞吐量。它也在发布管道中并且正在运行。

目前,吞吐量是在数据库级别提供的,并在所有容器之间共享。如何在容器级别配置吞吐量?我尝试运行this ARM 模板来更新容器级别的吞吐量。似乎一旦在数据库级别配置共享吞吐量,就无法在容器级别配置吞吐量。

我找到了this 参考文档,但未列出吞吐量。我是否遗漏了一些非常明显的东西,或者尚未实现所需的功能?

更新: 尝试使用上述模板更新容器时,我得到以下信息:

2019-05-29T20:25:10.5166366Z There were errors in your deployment. Error code: DeploymentFailed.
2019-05-29T20:25:10.5236514Z ##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
2019-05-29T20:25:10.5246027Z ##[error]Details:
2019-05-29T20:25:10.5246412Z ##[error]NotFound: {
  "code": "NotFound",
  "message": "Entity with the specified id does not exist in the system.\r\nActivityId: 7ba84...b52b2, Microsoft.Azure.Documents.Common/2.4.0.0"
} undefined
2019-05-29T20:25:10.5246730Z ##[error]Task failed while creating or updating the template deployment.

【问题讨论】:

    标签: azure azure-resource-manager arm-template


    【解决方案1】:

    我也遇到了同样的错误:

      "code": "NotFound",
      "message": "Entity with the specified id does not exist in the system.
    

    我正在通过 DevOps 管道部署 ARM 模板来更改 Azure 中现有资源的配置。

    现有资源在容器/集合级别定义了专用吞吐量,而我的 ARM 模板试图在数据库级别定义吞吐量...

    一旦调整我的部署管道就可以工作了。

    以下是有关我的吞吐量配置修复的一些信息:https://github.com/MicrosoftDocs/azure-docs/issues/30853

    【讨论】:

      【解决方案2】:

      我相信您必须首先创建具有专用吞吐量的容器。我还没有看到任何将容器从共享吞吐量更改为专用吞吐量的文档。在 Microsoft documentation 中,示例是创建具有共享吞吐量和专用吞吐量的容器。

      在数据库和容器上设置吞吐量

      您可以结合使用这两种模型。允许在数据库和容器上提供吞吐量。以下示例展示了如何在 Azure Cosmos 数据库和容器上预配吞吐量:

      • 您可以创建一个名为 Z 的 Azure Cosmos 数据库,其预配吞吐量为“K”个 RU。
      • 接下来,在数据库中创建五个名为 A、B、C、D 和 E 的容器。创建容器 B 时,请确保启用为此容器选项提供专用吞吐量,并在此容器上显式配置“P”个已提供吞吐量的 RU。请注意,您只能在创建数据库和容器时配置共享和专用吞吐量。
      • “K”个 RU 吞吐量在四个容器 A、C、D 和 E 之间共享。A、C、D 或 E 可用的确切吞吐量量各不相同。每个容器的吞吐量没有 SLA。
      • 保证名为 B 的容器始终获得“P”RU 吞吐量。它由 SLA 提供支持。

      101-cosmosdb-sql-container-ru-update 的子文件夹中有一个 prereq ARM 模板。在 prereq 版本中,容器在创建容器时设置了 throughput 属性。使用专用吞吐量创建容器后,更新模板可以正常工作。我已经尝试过并验证它有效。

              {
                  "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
                  "name": "[concat(variables('accountName'), '/sql/', variables('databaseName'))]",
                  "apiVersion": "2016-03-31",
                  "dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('accountName'))]" ],
                  "properties":{
                      "resource":{
                          "id": "[variables('databaseName')]"
                      },
                      "options": { "throughput": "[variables('databaseThroughput')]" }
                  }
              },
              {
                  "type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/containers",
                  "name": "[concat(variables('accountName'), '/sql/', variables('databaseName'), '/', variables('containerName'))]",
                  "apiVersion": "2016-03-31",
                  "dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('accountName'), 'sql', variables('databaseName'))]" ],
                  "properties":
                  {
                      "resource":{
                          "id":  "[variables('containerName')]",
                          "partitionKey": {
                              "paths": [
                              "/MyPartitionKey1"
                              ],
                              "kind": "Hash"
                          }
                      },
                      "options": { "throughput": "[variables('containerThroughput')]" }
                  }
              }
      
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-29
        • 2015-04-12
        • 2016-03-17
        相关资源
        最近更新 更多