【问题标题】:Switch cosmosdb from manual to autoscale将 cosmosdb 从手动切换到自动缩放
【发布时间】:2021-03-31 14:16:38
【问题描述】:

是否可以使用 ARM 模板将 cosmosdb 容器从手动切换到自动缩放?

我正在尝试使用以下 arm 来实现这一点,但我仍然将 TU 设置设置为手动

{
  "name": "db/collection/container/default",
  "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings",
  "apiVersion": "2020-03-01",
  "properties": {
    "resource": {
      "throughput": "4000",
      "autoscaleSettings": {
        "maxThroughput": "800000"
      }
    }
  },

【问题讨论】:

  • 我认为通过门户modify the setting 更容易。一定要用arm模板吗?
  • 我认为 arm 模板用于部署,所以也许this doc 可以帮助你。顺便说一句,您可以创建一个 cosmosdb 和一个自动缩放容器,而不是选择导出模板以查看此类实例的设置。
  • 我有多区域部署,其中一些已经部署,一些正在升级所有部署都是通过 arm 模板完成的,除了 cosmodbcollections,但如果是,我也想切换到通过 arm 部署它们没有那么难,不值得花时间。
  • 感谢您的回复,马克提供了一个很好的答案:)
  • 请注意,如果你达到 800,000,你将无法回到 4000。Minimum throughput = Highest RU/s provisioned on the database / 100docs.microsoft.com/nl-nl/azure/cosmos-db/…

标签: azure-cosmosdb autoscaling arm-template throughput


【解决方案1】:

无法执行此操作,因为此调用是 Cosmos DB 资源提供程序上的 POST。

从标准吞吐量迁移到自动缩放吞吐量的唯一方法是使用 Azure 门户、PowerShell 或 Azure CLI。然后,您可以通过在资源选项中使用适当的吞吐量 json 重新部署模板来修改 ARM 模板并更新吞吐量。

这是从标准到自动缩放的容器的 PS 示例。

Invoke-AzCosmosDBSqlContainerThroughputMigration `
   -ResourceGroupName $resourceGroupName `
   -AccountName $accountName `
   -DatabaseName $databaseName `
   -Name $containerName `
   -ThroughputType Autoscale

更多PowerShell examples

这是从标准到自动缩放的容器的 cli 示例

az cosmosdb sql container throughput migrate \
-a $accountName \
-g $resourceGroupName \
-d $databaseName \
-n $containerName \
-t 'autoscale'

更多CLI examples

如果为其他数据库 API 执行此操作,请在文档中找到 PS 或 CLI 示例。所有数据库 API 都有示例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-17
    • 2019-11-07
    • 2018-04-25
    • 2011-02-08
    • 1970-01-01
    • 2020-05-07
    • 2015-06-04
    • 1970-01-01
    相关资源
    最近更新 更多