建立具有異地區域冗余儲存體(切換)(預覽)的高可用性 Azure 儲存體應用程式Build highly available Azure Storage applications with geo-zone-redundant storage (GZRS) (preview)

異地區域冗余儲存體(切換)(預覽)結婚區域冗余儲存體(ZRS)的高可用性,並防止異地多餘儲存體(GRS)所提供的區域性中斷。Geo-zone-redundant storage (GZRS) (preview) marries the high availability of zone-redundant storage (ZRS) with protection from regional outages as provided by geo-redundant storage (GRS). 切換儲存體帳戶中的資料會複寫到主要區域中的三個Azure 可用性區域,也會複寫到次要地理區域,以保護不受區域性災難的影響。Data in a GZRS storage account is replicated across three Azure availability zones in the primary region and also replicated to a secondary geographic region for protection from regional disasters. 每個 Azure 區域都會與相同地理位置內的另一個區域配對,以共同形成區域配對。Each Azure region is paired with another region within the same geography, together making a regional pair. 如需詳細資訊和例外狀況,請參閱For more details and exceptions refer to the documentation.

透過切換儲存體帳戶,您可以在可用性區域無法使用或無法復原時,繼續讀取和寫入資料。With a GZRS storage account, you can continue to read and write data if an availability zone becomes unavailable or is unrecoverable. 此外,如果發生全區域中斷或嚴重損壞而無法復原主要區域的情況,您的資料也會是持久的。Additionally, your data is also durable in the case of a complete regional outage or a disaster in which the primary region isn’t recoverable. 切換的設計目的是要在指定的一年內提供至少 99.99999999999999% (16個9)的物件持久性。GZRS is designed to provide at least 99.99999999999999% (16 9's) durability of objects over a given year. 切換也提供與 LRS、ZRS、GRS 或 RA-GRS 相同的擴充性目標GZRS also offers the same scalability targets as LRS, ZRS, GRS, or RA-GRS. 如果您的應用程式需要能夠在主要區域發生嚴重損壞時讀取資料,您可以選擇性地使用讀取權限異地區域冗余儲存體(RA-切換)來啟用次要區域中資料的讀取權限。You can optionally enable read access to data in the secondary region with read-access geo-zone-redundant storage (RA-GZRS) if your applications need to be able to read data in the event of a disaster in the primary region.

Microsoft 建議針對需要一致性、持久性、高可用性、絕佳效能和復原的應用程式,使用切換來進行嚴重損壞修復。Microsoft recommends using GZRS for applications requiring consistency, durability, high availability, excellent performance, and resilience for disaster recovery. 如需在發生區域性嚴重損壞時,對次要區域進行讀取存取的額外安全性,請為您的儲存體帳戶啟用 [RA-切換]。For the additional security of read access to the secondary region in the event of a regional disaster, enable RA-GZRS for your storage account.

關於預覽About the preview

只有一般用途 v2 儲存體帳戶支援切換和 RA 切換。Only general-purpose v2 storage accounts support GZRS and RA-GZRS. 如需有關儲存體帳戶類型的詳細資訊,請參閱 Azure 儲存體帳戶概觀For more information about storage account types, see Azure storage account overview. 切換和 RA-切換支援區塊 blob、不是 VHD 磁片、檔案、資料表和佇列的分頁 blob。GZRS and RA-GZRS support block blobs, page blobs that are not VHD disks, files, tables, and queues.

切換和 RA-切換目前在下欄區域提供預覽:GZRS and RA-GZRS are currently available for preview in the following regions:

  • 北歐Europe North
  • 西歐Europe West
  • 美國東部US East
  • 美國東部 2US East 2
  • 美國中部US Central

Microsoft 會繼續在其他 Azure 區域中啟用切換和 RA 切換。Microsoft continues to enable GZRS and RA-GZRS in additional Azure regions. 請定期查看Azure 服務更新頁面,以取得支援區域的相關資訊。Check the Azure Service Updates page regularly for information about supported regions.

如需預覽定價的詳細資訊,請參閱blob、檔案、佇列資料表的切換預覽定價。For information on preview pricing, refer to GZRS preview pricing for Blobs, Files, Queues, and Tables.

重要

Microsoft 建議不要針對生產工作負載使用預覽功能。Microsoft recommends against using preview features for production workloads.

切換和 RA 切換的工作方式How GZRS and RA-GZRS work

當資料寫入至已啟用切換或 RA 切換的儲存體帳戶時,該資料會先在主要區域中以同步方式跨三個可用性區域進行複寫。When data is written to a storage account with GZRS or RA-GZRS enabled, that data is first replicated synchronously in the primary region across three availability zones. 然後,資料會以非同步方式複寫到相距數百英里的第二個區域。The data is then replicated asynchronously to a second region that is hundreds of miles away. 當資料寫入次要區域時,會使用本機多餘的儲存體(LRS),在該區域內以同步方式進一步複寫三次。When the data is written to the secondary region, it's further replicated synchronously three times within that region using locally redundant storage (LRS).

重要

非同步複寫牽涉到將資料寫入主要區域,以及何時複寫到次要區域之間的延遲時間。Asynchronous replication involves a delay between the time that data is written to the primary region and when it is replicated to the secondary region. 當發生區域性災害時,如果無法從主要區域復原尚未複寫到次要區域的變更,則這些變更可能會遺失。In the event of a regional disaster, changes that haven't yet been replicated to the secondary region may be lost if that data can't be recovered from the primary region.

當您建立儲存體帳戶時,可以指定要如何複寫該帳戶中的資料,而且您也可以指定該帳戶的主要區域。When you create a storage account, you specify how data in that account is to be replicated, and you also specify the primary region for that account. 異地複寫帳戶的配對次要區域是根據主要區域而定,且無法變更。The paired secondary region for a geo-replicated account is determined based on the primary region and can't be changed. 如需有關 Azure 所支援區域的最新資訊,請參閱商務持續性和災害復原 (BCDR):Azure 配對區域For up-to-date information about regions supported by Azure, see Business continuity and disaster recovery (BCDR): Azure paired regions. 如需使用切換或 RA-切換建立儲存體帳戶的相關資訊,請參閱建立儲存體帳戶For information about creating a storage account using GZRS or RA-GZRS, see Create a storage account.

使用 RA-切換來提供高可用性Use RA-GZRS for high availability

當您啟用儲存體帳戶的切換時,您的資料可以從次要端點和儲存體帳戶的主要端點讀取。When you enable RA-GZRS for your storage account, your data can be read from the secondary endpoint as well as from the primary endpoint for your storage account. 次要端點會將尾碼 (次要) 附加至帳戶名稱。The secondary endpoint appends the suffix –secondary to the account name. 例如,如果 Blob 服務的主要端點是 myaccount.blob.core.windows.net,則次要端點會是 myaccount-secondary.blob.core.windows.netFor example, if your primary endpoint for the Blob service is myaccount.blob.core.windows.net, then your secondary endpoint is myaccount-secondary.blob.core.windows.net. 主要和次要端點會有相同的儲存體帳戶存取金鑰。The access keys for your storage account are the same for both the primary and secondary endpoints.

若要在發生區域性中斷的情況下利用切換的功能,您必須事先設計應用程式來處理此案例。To take advantage of RA-GZRS in the event of a regional outage, you must design your application in advance to handle this scenario. 您的應用程式應該讀取及寫入主要端點,但在主要區域無法使用的情況下,請切換為使用次要端點。Your application should read from and write to the primary endpoint, but switch to using the secondary endpoint in the event that the primary region becomes unavailable. 如需使用 RA 切換設計高可用性的指引,請參閱使用 ra-切換或 RA-GRS 設計高度可用的應用程式For guidance on designing for high availability with RA-GZRS, see Designing Highly Available Applications using RA-GZRS or RA-GRS.

由於資料會以非同步方式複寫到次要區域,因此次要區域通常會在主要區域後面。Because data is replicated to the secondary region asynchronously, the secondary region is often behind the primary region. 若要判斷哪些寫入作業已複寫到次要區域,您的應用程式會檢查儲存體帳戶的上次同步處理時間。To determine which write operations have been replicated to the secondary region, your application check the last sync time for your storage account. 在上次同步處理時間之前寫入主要區域的所有寫入作業,都已成功複寫到次要區域,這表示它們可以從次要資料庫讀取。All write operations written to the primary region prior to the last sync time have been successfully replicated to the secondary region, meaning that they are available to be read from the secondary. 在上次同步處理時間之後寫入主要區域的任何寫入作業,可能會或可能尚未複寫到次要區域,這表示它們可能無法供讀取作業使用。Any write operations written to the primary region after the last sync time may or may not have been replicated to the secondary region, meaning that they may not be available for read operations.

您可以使用 Azure PowerShell、Azure CLI 或其中一個 Azure 儲存體用戶端程式庫,查詢 [上次同步時間] 屬性的值。You can query the value of the Last Sync Time property using Azure PowerShell, Azure CLI, or one of the Azure Storage client libraries. [上次同步時間] 屬性是 GMT 日期/時間值。The Last Sync Time property is a GMT date/time value.

如需有關切換的效能和擴充性的其他指引,請參閱Microsoft Azure 儲存體效能和擴充性檢查清單For additional guidance on performance and scalability with RA-GZRS, see the Microsoft Azure Storage performance and scalability checklist.

可用性區域中斷Availability zone outages

如果失敗影響主要區域中的可用性區域,您的應用程式可以使用該區域的其他可用性區域,順暢地繼續讀取和寫入您的儲存體帳戶。In the event of a failure affecting an availability zone in the primary region, your applications can seamlessly continue to read from and write to your storage account using the other availability zones for that region. Microsoft 建議您在使用切換或 ZRS 時,繼續遵循暫時性錯誤處理的作法。Microsoft recommends that you continue to follow practices for transient fault handling when using GZRS or ZRS. 這些做法包括實作具有指數輪詢的重試原則。These practices include implementing retry policies with exponential back-off.

當可用性區域變得無法使用時,Azure 科學家網路更新,例如 DNS 重新指向。When an availability zone becomes unavailable, Azure undertakes networking updates, such as DNS re-pointing. 如果您在更新完成之前存取資料,這些更新可能會影響您的應用程式。These updates may affect your application if you are accessing data before the updates have completed.

區域中斷Regional outages

如果失敗影響整個主要區域,則 Microsoft 會先嘗試還原主要區域。If a failure affects the entire primary region, then Microsoft will first attempt to restore the primary region. 如果無法還原,Microsoft 就會故障轉換到次要區域,讓次要區域成為新的主要區域。If restoration is not possible, then Microsoft will fail over to the secondary region, so that the secondary region becomes the new primary region. 如果儲存體帳戶已啟用切換,則針對此案例所設計的應用程式可以在等候容錯移轉時,從次要區域讀取。If the storage account has RA-GZRS enabled, then applications designed for this scenario can read from the secondary region while waiting for failover. 如果儲存體帳戶未啟用切換,則在容錯移轉完成之前,應用程式將無法讀取次要資料庫。If the storage account does not have RA-GZRS enabled, then applications will not be able to read from the secondary until the failover is complete.

注意

切換和 RA-切換目前僅在美國東部地區處於預覽狀態。GZRS and RA-GZRS are currently in preview in the US East region only. 美國東部2尚未提供客戶管理的帳戶容錯移轉(預覽),因此客戶目前無法使用切換和 RA 切換帳戶來管理帳戶容錯移轉事件。Customer-managed account failover (preview) is not yet available in US East 2, so customers cannot currently manage account failover events with GZRS and RA-GZRS accounts. 在預覽期間,Microsoft 將會管理影響切換和 RA 切換帳戶的任何容錯移轉事件。During the preview, Microsoft will manage any failover events affecting GZRS and RA-GZRS accounts.

由於資料會以非同步方式複寫到次要區域,因此如果無法復原主要區域,則會影響主要區域的失敗可能會導致資料遺失。Because data is replicated to the secondary region asynchronously, a failure that affects the primary region may result in data loss if the primary region cannot be recovered. 最近寫入主要區域和上次寫入次要區域之間的間隔,稱為復原點目標(RPO)。The interval between the most recent writes to the primary region and the last write to the secondary region is known as the recovery point objective (RPO). RPO 表示可復原資料的時間點。The RPO indicates the point in time to which data can be recovered. Azure 儲存體通常會有不到15分鐘的 RPO,但目前並沒有將資料複寫到次要區域所需時間的 SLA。Azure Storage typically has an RPO of less than 15 minutes, although there's currently no SLA on how long it takes to replicate data to the secondary region.

復原時間目標(RTO)是一種測量執行容錯移轉和讓儲存體帳戶恢復上線所需的時間。The recovery time objective (RTO) is a measure of how long it takes to perform the failover and get the storage account back online. 此量值會藉由變更主要 DNS 專案以指向次要位置,來指出 Azure 執行容錯移轉所需的時間。This measure indicates the time required by Azure to perform the failover by changing the primary DNS entries to point to the secondary location.

將儲存體帳戶遷移至切換或 RA-切換Migrate a storage account to GZRS or RA-GZRS

您可以將任何現有的儲存體帳戶遷移至切換或 RA-切換。You can migrate any existing storage account to GZRS or RA-GZRS. 從現有的 ZRS 帳戶遷移至切換或 RA-切換相當簡單,而從 LRS、GRS 或 RA-GRS 帳戶進行遷移比較複雜。Migrating from an existing ZRS account to GZRS or RA-GZRS is straightforward, while migrating from an LRS, GRS, or RA-GRS account is more involved. 下列各節說明如何在任一情況下遷移。The following sections describe how to migrate in either case.

從 ZRS 帳戶進行遷移Migrating from a ZRS account

若要將現有的 ZRS 帳戶轉換為切換,請使用new-azstorageaccount Cmdlet 來變更帳戶的 SKU。To convert an existing ZRS account to RA-GZRS, use the Set-AzStorageAccount cmdlet to change the SKU for the account. 請記得使用您自己的值來取代預留位置值:Remember to replace the placeholder values with your own values:

Set-AzStorageAccount -ResourceGroupName <resource-group> -AccountName <storage-account> -SkuName "Standard_RAGZRS"

從 LRS、GRS 或 RA GRS 帳戶進行遷移Migrating from an LRS, GRS, or RA-GRS account

有兩個選項可從 LRS、GRS 或 RA-GRS 帳戶遷移至切換或 RA-切換:There are two options for migrating to GZRS or RA-GZRS from an LRS, GRS, or RA-GRS account:

  • 您可以從現有的帳戶手動將資料複製或移動到新的切換或 RA 切換帳戶。You can manually copy or move data to a new GZRS or RA-GZRS account from an existing account.
  • 您可以要求即時移轉。You can request a live migration.

執行手動遷移Perform a manual migration

如果您需要以特定日期完成遷移,請考慮執行手動遷移。If you need the migration to complete by a certain date, consider performing a manual migration. 手動移轉比即時移轉更具彈性。A manual migration provides more flexibility than a live migration. 使用手動移轉時,您可以控制時間。With a manual migration, you're in control of the timing.

若要手動將資料從現有的帳戶遷移到切換或 RA 切換帳戶,請使用可有效率地複製資料的工具。To manually migrate data from an existing account to a GZRS or RA-GZRS account, use a tool that can copy data efficiently. 部分範例包括:Some examples include:

  • 使用 AzCopy 或可靠的協力廠商工具之類的公用程式。Use a utility like AzCopy or a reliable third-party tool. 如需 AzCopy 的相關資訊,請參閱開始使用 AzCopyFor information about AzCopy, see Get started with AzCopy.
  • 如果您熟悉 Hadoop 或 HDInsight,請將來源和目的地儲存體帳戶連結到您的叢集。If you're familiar with Hadoop or HDInsight, attach both the source and destination storage accounts to your cluster. 接下來,使用 DistCp 之類的工具來平行處理資料複製程式。Next, parallelize the data copy process with a tool like DistCp.
  • 使用其中一個「Azure 儲存體」用戶端程式庫來建置您自己的工具。Build your own tooling using one of the Azure Storage client libraries.

執行即時移轉Perform a live migration

手動移轉可能造成應用程式停機。A manual migration can result in application downtime. 如果您的應用程式要求高可用性,Microsoft 也提供即時移轉選項。If your application requires high availability, Microsoft also provides a live migration option. 即時移轉是一種不需停機的就地移轉。A live migration is an in-place migration with no downtime.

在即時移轉期間,您可以在來源和目的地儲存體帳戶之間遷移資料時,使用您的儲存體帳戶。During a live migration, you can use your storage account while your data is migrated between source and destination storage accounts. 在即時移轉過程中,您的帳戶會繼續符合其持久性和可用性的 SLA。During the live migration process, your account continues to meet its SLA for durability and availability. 即時移轉不會造成停機或資料遺失。There is no downtime or data loss caused by the live migration.

只有一般用途 v2 帳戶支援切換/RA-切換,因此在提交即時移轉至切換/RA 切換的要求之前,您必須將帳戶升級為一般用途 v2。Only general-purpose v2 accounts support GZRS/RA-GZRS, so before submitting a request for a live migration to GZRS/RA-GZRS, you must upgrade your account to general-purpose v2. 如需詳細資訊,請參閱Azure 儲存體帳戶總覽升級至一般用途 v2 儲存體帳戶For more information, see Azure storage account overview and Upgrade to a general-purpose v2 storage account.

完成遷移之後,儲存體帳戶的複寫設定會更新為異地區域冗余儲存體(切換)讀取權限異地區域-多餘儲存體(RA-切換)Once the migration is complete, the storage account's replication setting will be updated to Geo-zone-redundant storage (GZRS) or Read-access geo-zone-redundant storage (RA-GZRS). 服務端點、存取金鑰、共用存取簽章(SAS)和任何其他帳戶設定選項會保持不變且原封不動。Service endpoints, access keys, shared access signatures (SAS), and any other account configuration options remain unchanged and intact.

請記住下列即時移轉限制:Keep in mind the following restrictions on live migration:

  • 雖然 Microsoft 會迅速處理您的即時移轉要求,但不保證移轉何時會完成。While Microsoft handles your request for live migration promptly, there's no guarantee as to when a live migration will complete. 如果您需要依特定日期遷移至切換或 RA 切換的資料,Microsoft 建議您改為執行手動遷移。If you need your data migrated to GZRS or RA-GZRS by a certain date, then Microsoft recommends that you perform a manual migration instead. 一般而言,您帳戶中的資料越多,移轉該資料所需的時間就越長。Generally, the more data you have in your account, the longer it takes to migrate that data.
  • 您的帳戶必須包含資料。Your account must contain data.
  • 您只能在相同的區域內移轉資料。You can only migrate data within the same region.
  • 只有標準儲存體帳戶類型支援即時移轉。Only standard storage account types support live migration. 進階儲存體帳戶必須以手動方式移轉。Premium storage accounts must be migrated manually.
  • 不支援從切換或 RA 切換帳戶即時移轉至 LRS、GRS 或 RA-GRS 帳戶。Live migration from a GZRS or RA-GZRS account to an LRS, GRS, or RA-GRS account is not supported. 您必須手動將資料移至新的或現有的儲存體帳戶。You will need to manually move the data to a new or an existing storage account.
  • 您可以要求從 GRS 到 RA-切換的即時移轉。You can request a live migration from RA-GRS to RA-GZRS. 不過,不支援從 RA-GRS 遷移至切換。However, migrating from RA-GRS to GZRS is not supported. 在此情況下,您必須要求即時移轉至切換,然後以手動方式將儲存體帳戶轉換為使用切換。In this case, you must request a live migration to RA-GZRS and then manually convert the storage account to use GZRS.
  • 受控磁片僅支援 LRS,且無法遷移至切換或 RA-切換。Managed disks support LRS only and cannot be migrated to GZRS or RA-GZRS. 如需與可用性設定組整合的詳細說明,請參閱Azure 受控磁片簡介For integration with availability sets, see Introduction to Azure managed disks.
  • 您可以在標準 HDD 儲存體上儲存標準 SSD 受控磁碟的快照集和映射,並在LRS、ZRS、切換和 RA 切換選項之間進行選擇You can store snapshots and images for Standard SSD Managed Disks on Standard HDD storage and choose between LRS, ZRS, GZRS, and RA-GZRS options.
  • 切換不支援包含大型檔案共用的帳戶。Accounts containing large file shares are not supported for GZRS.

若要要求即時移轉,請使用Azure 入口網站To request a live migration, use the Azure portal. 從入口網站中,選取要遷移至切換或 RA 切換的儲存體帳戶,並遵循下列指示:From the portal, select the storage account to migrate to GZRS or RA-GZRS, and follow these instructions:

  1. 選取 [新增支援要求]。Select New Support Request.
  2. 根據您的帳戶資訊,完成 [基本] 資訊。Complete the Basics based on your account information. 在 [服務] 區段中,選取 [儲存體帳戶管理],並指定要遷移的帳戶。In the Service section, select Storage Account Management and specify the account to be migrated.
  3. 選取 [下一步]。Select Next.
  4. 在 [問題] 區段中,指定下列值︰Specify the following values the Problem section:
    • 嚴重性:將預設值保持不變。Severity: Leave the default value as-is.
    • 問題類型:選取 [資料移轉]。Problem Type: Select Data Migration.
    • 類別:選取區域內的 [遷移至(RA-)切換]。Category: Select Migrate to (RA-)GZRS within a region.
    • 標題:輸入描述性標題,例如 (RA-)切換帳戶遷移Title: Type a descriptive title, for example, (RA-)GZRS account migration.
    • 詳細資料:在 [詳細資料] 方塊中輸入其他詳細資料,例如,在 _ @ no__t-2 區域中,[我要從 [LRS,GRS] 遷移至切換]。Details: Type additional details in the Details box, for example, "I would like to migrate to GZRS from [LRS, GRS] in the __ region." 或者,我想要從 _ @ no__t-1 區域中的 [LRS,RA-GRS] 遷移至 [RA-切換]。or "I would like to migrate to RA-GZRS from [LRS, RA-GRS] in the __ region."
  5. 選取 [下一步]。Select Next.
  6. 確認 [連絡人資訊] 刀鋒視窗上的連絡人資訊正確。Verify that the contact information is correct on the Contact information blade.
  7. 選取 [建立]。Select Create.

支援代表會聯絡您以提供協助。A support representative will contact you to provide assistance.

另請參閱See also