你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
az cosmosdb postgres cluster
管理 Azure Cosmos DB for PostgreSQL 群集。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az cosmosdb postgres cluster create |
使用节点创建新群集。 |
核心 | GA |
az cosmosdb postgres cluster delete |
将群集与其中节点一起删除。 |
核心 | GA |
az cosmosdb postgres cluster list |
列出订阅或资源组中的所有群集。 |
核心 | GA |
az cosmosdb postgres cluster promote |
将读取副本 (replica)群集提升为独立的读写群集。 |
核心 | GA |
az cosmosdb postgres cluster restart |
重启群集中的所有节点。 |
核心 | GA |
az cosmosdb postgres cluster server |
管理用于 PostgreSQL 群集服务器的 Azure Cosmos DB。 |
核心 | GA |
az cosmosdb postgres cluster server list |
列出群集的节点。 |
核心 | GA |
az cosmosdb postgres cluster server show |
获取有关群集中的节点的信息。 |
核心 | GA |
az cosmosdb postgres cluster show |
获取有关群集的信息,例如计算和存储配置以及群集生命周期元数据,例如群集创建日期和时间。 |
核心 | GA |
az cosmosdb postgres cluster start |
在所有群集节点上启动停止计算。 |
核心 | GA |
az cosmosdb postgres cluster stop |
停止所有群集节点上的计算。 |
核心 | GA |
az cosmosdb postgres cluster update |
更新现有群集。 请求正文可以包含群集定义的一个或多个属性。 |
核心 | GA |
az cosmosdb postgres cluster wait |
将 CLI 置于等待状态,直到满足条件。 |
核心 | GA |
az cosmosdb postgres cluster create
使用节点创建新群集。
使用以下参考来确定 Azure Cosmos DB for PostgreSQL 群集和节点 CLI 命令的各种参数支持的值: https://learn.microsoft.com/rest/api/postgresqlhsc/#values
az cosmosdb postgres cluster create --cluster-name
--resource-group
[--administrator-login-password]
[--citus-version]
[--coord-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--coord-server-edition]
[--coordinator-storage]
[--coordinator-v-cores]
[--enable-ha {0, 1, f, false, n, no, t, true, y, yes}]
[--enable-shards-on-coord {0, 1, f, false, n, no, t, true, y, yes}]
[--location]
[--maintenance-window]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--node-count]
[--node-enable-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--node-server-edition]
[--node-storage]
[--node-v-cores]
[--point-in-time-utc]
[--postgresql-version]
[--preferred-primary-zone]
[--source-location]
[--source-resource-id]
[--tags]
示例
创建新的单节点群集
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 8 --coordinator-server-edition "GeneralPurpose" --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
创建新的群集作为时间点还原
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --point-in-time-utc "2017-12-14T00:00:37.467Z" --source-location "eastus" --source-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"
以读取副本 (replica)的形式创建新群集
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --source-location "eastus" --source-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"
创建新的多节点群集
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 8 --coordinator-server-edition "GeneralPurpose" --coordinator-storage 131072 --enable-shards-on-coord false --node-count 3 --node-server-edition "MemoryOptimized" --node-v-cores 8 --node-storage 131072 --postgresql-version "15" --preferred-primary-zone "1" --administrator-login-password "password"
创建新的单节点可突发 1 个 vCore 群集
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 1 --coordinator-server-edition "BurstableMemoryOptimized" --coord-public-ip-access true --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
创建新的单节点可突发 2 个 vCore 群集
az cosmosdb postgres cluster create -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --enable-ha false --coordinator-v-cores 2 --coordinator-server-edition "BurstableGeneralPurpose" --coord-public-ip-access true --coordinator-storage 131072 --enable-shards-on-coord true --node-count 0 --preferred-primary-zone "1" --administrator-login-password "password"
必需参数
群集的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
管理员登录名的密码。 创建时需要。 如果值为空,则从 tty 中询问该值。
所有群集服务器上的 Citus 扩展版本。
如果在协调器上启用了公共访问。
协调器服务器的版本(默认值:GeneralPurpose)。 创建时需要。
服务器的存储(以 MB 为单位)。 创建时需要。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
服务器的 vCore 计数(最大值:96)。 创建时需要。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
如果为群集启用了或未启用高可用性(HA)。
如果协调器上的分片已启用或不为群集启用。
未指定资源所在的地理位置,将使用资源组的位置。
群集的维护时段。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
不等待长时间运行的操作完成。
群集的工作器节点计数。 当节点计数为 0 时,它表示单个节点配置,能够在该节点上创建分布式表。 2 个或更多个工作器节点表示多节点配置。 节点计数值不能为 1。 创建时需要。
如果在工作器节点上启用了公共访问。
节点服务器的版本(默认值:MemoryOptimized)。
每个工作器节点上的存储(以 MB 为单位)。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
每个工作器节点上 vCore 中的计算(最大值:104)。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
群集还原的日期和时间(ISO8601格式)。
所有群集服务器上的主要 PostgreSQL 版本。
所有群集服务器的首选主可用性区域 (AZ)。
用于读取副本 (replica)群集的源群集的 Azure 区域。
用于读取副本 (replica)群集的源群集的资源 ID。
资源标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster delete
将群集与其中节点一起删除。
az cosmosdb postgres cluster delete [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
[--yes]
示例
删除群集
az cosmosdb postgres cluster delete -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
不等待长时间运行的操作完成。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
不提示确认。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster list
列出订阅或资源组中的所有群集。
az cosmosdb postgres cluster list [--resource-group]
示例
列出资源组中的群集
az cosmosdb postgres cluster list -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
列出订阅中的群集
az cosmosdb postgres cluster list --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster promote
将读取副本 (replica)群集提升为独立的读写群集。
az cosmosdb postgres cluster promote [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
示例
将读取副本 (replica)群集提升为独立的读写群集
az cosmosdb postgres cluster promote -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
不等待长时间运行的操作完成。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster restart
重启群集中的所有节点。
az cosmosdb postgres cluster restart [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
示例
重启群集中的所有服务器
az cosmosdb postgres cluster restart -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
不等待长时间运行的操作完成。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster show
获取有关群集的信息,例如计算和存储配置以及群集生命周期元数据,例如群集创建日期和时间。
az cosmosdb postgres cluster show [--cluster-name]
[--ids]
[--resource-group]
[--subscription]
示例
显示群集的详细信息
az cosmosdb postgres cluster show -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster start
在所有群集节点上启动停止计算。
az cosmosdb postgres cluster start [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
示例
启动群集中的所有服务器
az cosmosdb postgres cluster start -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
不等待长时间运行的操作完成。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster stop
停止所有群集节点上的计算。
az cosmosdb postgres cluster stop [--cluster-name]
[--ids]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
示例
停止群集中的所有服务器
az cosmosdb postgres cluster stop -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff"
可选参数
群集的名称。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
不等待长时间运行的操作完成。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster update
更新现有群集。 请求正文可以包含群集定义的一个或多个属性。
使用以下参考来确定 Azure Cosmos DB for PostgreSQL 群集和节点 CLI 命令的各种参数支持的值: https://learn.microsoft.com/rest/api/postgresqlhsc/#values
az cosmosdb postgres cluster update [--administrator-login-password]
[--citus-version]
[--cluster-name]
[--coord-public-ip-access {0, 1, f, false, n, no, t, true, y, yes}]
[--coord-server-edition]
[--coordinator-storage]
[--coordinator-v-cores]
[--enable-ha {0, 1, f, false, n, no, t, true, y, yes}]
[--enable-shards-on-coord {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--maintenance-window]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--node-count]
[--node-server-edition]
[--node-storage]
[--node-v-cores]
[--postgresql-version]
[--preferred-primary-zone]
[--resource-group]
[--subscription]
[--tags]
示例
纵向扩展或缩减工作器节点计算
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-v-cores 16
横向扩展:添加新的工作器节点
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-count 2
纵向扩展工作器节点存储
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-storage 2097152
更新群集的多个配置设置
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --node-v-cores 16 --node-count 4 coordinator-v-cores 16 --administrator-login-password "newPassword"
更新或定义维护时段
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --maintenance-window day-of-week=1 start-hour=2 --start-minute=0 custom-window="Enabled"
升级 PostgreSQL 主版本
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --postgresql-version "15"
纵向扩展协调器存储
az cosmosdb postgres cluster update -n "test-cluster" -g "testGroup" --subscription "ffffffff-ffff-ffff-ffff-ffffffffffff" --coordinator-storage 2097152
可选参数
管理员登录名的密码。 创建时需要。 如果值为空,则从 tty 中询问该值。
所有群集服务器上的 Citus 扩展版本。
群集的名称。
如果在协调器上启用了公共访问。
协调器服务器的版本(默认值:GeneralPurpose)。 创建时需要。
服务器的存储(以 MB 为单位)。 创建时需要。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
服务器的 vCore 计数(最大值:96)。 创建时需要。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
如果为群集启用了或未启用高可用性(HA)。
如果协调器上的分片已启用或不为群集启用。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
群集的维护时段。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
不等待长时间运行的操作完成。
群集的工作器节点计数。 当节点计数为 0 时,它表示单个节点配置,能够在该节点上创建分布式表。 2 个或更多个工作器节点表示多节点配置。 节点计数值不能为 1。
节点服务器的版本(默认值:MemoryOptimized)。
每个工作器节点上的存储(以 MB 为单位)。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
每个工作器节点上 vCore 中的计算(最大值:104)。 有关详细信息,请参阅https://learn.microsoft.com/rest/api/postgresqlhsc/#values。
所有群集服务器上的主要 PostgreSQL 版本。
所有群集服务器的首选主可用性区域 (AZ)。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
键值对形式的应用程序特定元数据。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。
az cosmosdb postgres cluster wait
将 CLI 置于等待状态,直到满足条件。
az cosmosdb postgres cluster wait [--cluster-name]
[--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
可选参数
群集的名称。
等待在“Succeeded”中使用“provisioningState”创建。
等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
等到删除为止。
等待资源存在。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
轮询间隔(以秒为单位)。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
最大等待(以秒为单位)。
等到 provisioningState 更新为“Succeeded”。
全局参数
提高日志记录详细程度以显示所有调试日志。
显示此帮助消息并退出。
只显示错误,取消显示警告。
输出格式。
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
提高日志记录详细程度。 使用 --debug 获取完整的调试日志。