更改存储帐户的复制方式Change how a storage account is replicated

Azure 存储始终会存储数据的多个副本,以防范各种计划内和计划外的事件,包括暂时性的硬件故障、网络中断或断电、大范围自然灾害等。Azure Storage always stores multiple copies of your data so that it is protected from planned and unplanned events, including transient hardware failures, network or power outages, and massive natural disasters. 即使面临故障时,冗余也可确保存储帐户满足 Azure 存储的服务级别协议 (SLA)的要求。Redundancy ensures that your storage account meets the Service-Level Agreement (SLA) for Azure Storage even in the face of failures.

Azure 存储提供以下类型的复制:Azure Storage offers the following types of replication:

  • 本地冗余存储 (LRS)Locally redundant storage (LRS)
  • 异地冗余存储 (GRS) 或读取访问异地冗余存储 (RA-GRS)Geo-redundant storage (GRS) or read-access geo-redundant storage (RA-GRS)

有关这些选项每一个的概述,请参阅 Azure 存储冗余For an overview of each of these options, see Azure Storage redundancy.

在复制类型之间切换Switch between types of replication

可以将存储帐户从一种类型的复制切换到任何其他类型,但某些方案比另一些方案更直接。You can switch a storage account from one type of replication to any other type, but some scenarios are more straightforward than others. 若要添加或删除对次要区域的异地复制或读取访问权限,可以使用 Azure 门户、PowerShell 或 Azure CLI 来更新复制设置。If you want to add or remove geo-replication or read access to the secondary region, you can use the Azure portal, PowerShell, or Azure CLI to update the replication setting.

下表概述了如何从每种复制类型切换到另一种复制类型:The following table provides an overview of how to switch from each type of replication to another:

切换Switching …到 LRS…to LRS …到 GRS/RA-GRS…to GRS/RA-GRS
…从 LRS…from LRS 空值N/A 使用 Azure 门户、PowerShell 或 CLI 更改复制设置1Use Azure portal, PowerShell, or CLI to change the replication setting1
…从 GRS/RA-GRS…from GRS/RA-GRS 使用 Azure 门户、PowerShell 或 CLI 更改复制设置Use Azure portal, PowerShell, or CLI to change the replication setting 空值N/A

1 会产生一次性出口费用。1 Incurs a one-time egress charge.

更改复制设置Change the replication setting

只要不更改在主要区域中复制数据的方式,就可以使用 Azure 门户、PowerShell 或 Azure CLI 更改存储帐户的复制设置。You can use the Azure portal, PowerShell, or Azure CLI to change the replication setting for a storage account, as long as you are not changing how data is replicated in the primary region.

更改存储帐户的复制方式不会导致应用程序停机。Changing how your storage account is replicated does not result in down time for your applications.

若要在 Azure 门户中更改存储帐户的冗余选项,请执行以下步骤:To change the redundancy option for your storage account in the Azure portal, follow these steps:

  1. 导航到 Azure 门户中的存储帐户。Navigate to your storage account in the Azure portal.
  2. 选择配置设置。Select the Configuration setting.
  3. 更新复制设置。Update the Replication setting.

屏幕截图,其中显示了如何在门户中更改复制选项

与更改数据复制方式相关的成本Costs associated with changing how data is replicated

与更改数据复制方式相关的成本取决于你的转换路径。The costs associated with changing how data is replicated depend on your conversion path. 从最便宜到最昂贵的 Azure 存储冗余产品/服务依次为 LRS、GRS 和 RA-GRS。Ordering from least to the most expensive, Azure Storage redundancy offerings include LRS, GRS, and RA-GRS.

例如,从 LRS 转移到任何其他类型的复制会产生额外的费用,因为这是转移到更高级的冗余级别。For example, going from LRS to any other type of replication will incur additional charges because you are moving to a more sophisticated redundancy level. 迁移到 GRS 或 RA-GRS 会产生出口带宽费用,因为(主要区域中的)数据将复制到远程次要区域。Migrating to GRS or RA-GRS will incur an egress bandwidth charge because your data (in your primary region) is being replicated to your remote secondary region. 此费用是在初始设置期间收取的一次性费用。This charge is a one-time cost at initial setup. 复制数据后,无需进一步支付迁移费用。After the data is copied, there are no further migration charges. 有关带宽费用的详细信息,请参阅 Azure 存储定价页面For details on bandwidth charges, see Azure Storage Pricing page.

如果将存储帐户从 GRS 迁移到 LRS,则不会产生额外的费用,但从次要位置复制的数据将被删除。If you migrate your storage account from GRS to LRS, there is no additional cost, but your replicated data is deleted from the secondary location.

重要

如果将存储帐户从 RA-GRS 迁移到 GRS 或 LRS,则会在完成转换 30 天后以 RA-GRS 方式对该帐户计费。If you migrate your storage account from RA-GRS to GRS or LRS, that account is billed as RA-GRS for an additional 30 days beyond the date that it was converted.

另请参阅See also