使用 Azure CLI 自动增长 Azure Database for MariaDB 存储Auto-grow Azure Database for MariaDB storage using the Azure CLI

本文介绍如何将 Azure Database for MariaDB 服务器存储配置为在不影响工作负荷的情况下增长。This article describes how you can configure an Azure Database for MariaDB server storage to grow without impacting the workload.

达到存储限制的服务器将设置为只读。The server reaching the storage limit, is set to read-only. 如果启用了存储自动增长,则对于预配的存储大小小于 100 GB 的服务器,可用存储空间一旦小于 1 GB 或预配存储的 10%(以这二者中的较大值为准),预配的存储大小就会立即增加 5 GB。If storage auto grow is enabled then for servers with less than 100 GB provisioned storage, the provisioned storage size is increased by 5 GB as soon as the free storage is below the greater of 1 GB or 10% of the provisioned storage. 对于预配的存储大小大于 100 GB 的服务器,可用存储空间小于预配的存储大小的 5% 时,预配的存储大小就会增加 5%。For servers with more than 100 GB of provisioned storage, the provisioned storage size is increased by 5% when the free storage space is below 5% of the provisioned storage size. 此处所指定的最大存储限制适用。Maximum storage limits as specified here apply.

必备条件Prerequisites

若要完成本操作指南,需要:To complete this how-to guide, you need:

重要

本操作方法指南要求使用 Azure CLI 版本 2.0 或更高版本。This how-to guide requires that you use Azure CLI version 2.0 or later. 若要确认版本,请在 Azure CLI 命令提示符下输入 az --versionTo confirm the version, at the Azure CLI command prompt, enter az --version. 若要安装或升级,请参阅安装 Azure CLITo install or upgrade, see Install Azure CLI.

启用 MariaDB 服务器存储自动增长Enable MariaDB server storage auto-grow

使用以下命令在现有服务器上启用服务器自动增长存储:Enable server auto-grow storage on an existing server with the following command:

az mariadb server update --name mydemoserver --resource-group myresourcegroup --auto-grow Enabled

使用以下命令创建新服务器时启用服务器自动增长存储:Enable server auto-grow storage while creating a new server with the following command:

az mariadb server create --resource-group myresourcegroup --name mydemoserver  --auto-grow Enabled --location chinaeast2 --admin-user myadmin --admin-password <server_admin_password> --sku-name GP_Gen5_2 --version 10.3

后续步骤Next steps

了解如何基于指标创建警报Learn about how to create alerts on metrics.