分享方式:


使用Azure 應用程式一致快照集工具來還原

本文提供可搭配 Azure NetApp Files 使用之Azure 應用程式一致快照集工具還原命令的指南。

注意

還原命令僅適用于 Azure 大型實例和 Azure NetApp Files。 Azure 受控磁片的任何還原都必須使用 Azure 入口網站或 Azure CLI 來完成。

簡介

使用 命令從 azacsnap -c restore 快照集執行磁片區還原。

重要

這不會執行資料庫復原,只會復原磁碟區,如下列每個選項所述。

命令選項

此命令 -c restore 有下列選項:

  • --restore snaptovol 根據磁片區快照集建立新的磁片區。 此命令預設會使用最新的磁片區快照集作為基底,為組態檔中的每個磁片區建立新的「複製」磁片區。 如果是資料磁片區,可以使用 選項 --snapshotfilter <Snapshot Name> 選取要複製的快照集,只有在所有資料磁片區具有相同快照集時,才會完成此動作。 此命令不會中斷從主要複寫到次要的儲存體複寫。 相反地,快照集的複製會建立在相同的位置,並呈現複製磁片區的建議檔案系統掛接點。 如果在 Azure 大型實例系統上使用 ,則此命令應該在 DR 區域中 執行 (也就是目標容錯移轉系統)。

  • --restore revertvolume 根據磁片區快照集,將目標磁片區還原為先前的狀態。 使用此命令作為 DR 容錯移轉至配對 DR 區域的一部分。 此命令 停止從主要月臺到次要月臺的儲存體複寫,並將目標 DR 磁片區還原為 DR 磁片區上的最新可用快照集,以及已還原 DR 磁片區的建議檔案系統掛接點。 如果在 Azure 大型實例系統上使用 ,則此命令應該在 DR 區域中 執行 (也就是目標容錯移轉系統)。

    警告

    revertvolume 選項具有資料破壞性,因為選擇還原為的快照集之後儲存在磁片區中的任何內容都會遺失且無法復原。

    提示

    執行 revertvolume 之後,建議重新掛接磁片區,以確保沒有過時的檔案控制碼。 作法是使用 mount -o remount <mount_point>

  • --dbsid <SAP HANA SID> 是組態檔中所指定的資料庫 SID,可套用磁片區還原命令。

  • [--configfile <config filename>] 是允許自訂群組態檔名稱的選擇性參數。

執行測試 DR 容錯移轉 azacsnap -c restore --restore snaptovol

此命令就像「完整」DR 容錯移轉命令 ( --restore revertvolume ),但不會中斷主要月臺與災害復原網站之間的複寫,而是會從災害復原磁片區中建立複製磁片區,以還原 DR 網站中最新的快照集。 然後,這些複製的磁片區可供客戶測試災害復原,而不需要執行其 HANA 環境的完整容錯移轉,以中斷主要月臺與災害復原網站之間的複寫協定。

  • 您可以透過這種方式測試多個不同的還原點,每個還原點都有自己的還原點。
  • 複製是由執行命令時時間戳記所指定,並代表執行時可用的最新資料和其他快照集。

重要

此作業僅適用于 Azure 大型實例。

  • 執行此命令時,需要連絡電子郵件,才能讓作業在 4 周後刪除複製品之前與其聯繫。
  • 此命令的每個執行都會建立新的複製品,此複製品必須在測試結束時由 Microsoft Operations 刪除。
  • 建立的任何複製磁片區都會在 4 周後自動刪除。

組態檔 (例如, DR.json ) 應該只包含 DR 磁片區,而不是生產磁片區,否則生產磁片區可能會建立複製品。

命令的 azacsnap -c restore --restore snaptovol 輸出(適用于單一節點案例)

> azacsnap --configfile DR.json -c restore --restore snaptovol --dbsid H80
* This program is designed for those customers who have previously installed the
  Production HANA instance in the Disaster Recovery Location either as a
  stand-alone instance or as part of a multi-purpose environment.
* This program should be executed from the Disaster Recovery location otherwise
  unintended consequences may result.
* This program is intended to allow the customer to simulate a Disaster Recovery
  failover without actually requiring a failover and subsequent failback.
* Any other restore points must be handled by Microsoft Operations.
* As part of the process, a clone is created of the each of the 'data' and 'other'
  volumes per the configuration file.

Do you wish to continue? (y/n) [n]: y

About to create clones of volumes based on the latest snapshot, these will be
kept for 4 weeks before being automatically deleted by Microsoft Operations.
Enter an email address to contact when deleting clones: <b>person@nowhere.com</b>
Checking state of HLI volumes for SID 'PEW'
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Configured volumes (Data and Other) are not ready to clone, will retry in 00:00:10 seconds
Displaying Mount Points by Volume as follows:
10.50.251.34:/hana_data_h80_sapprdhdb80_mnt00001_t020_xdp_rwclone_20200916_0256  /hana/data/H80/mnt00001 nfs  rw,bg,hard,timeo=600,vers=4,rsize=1048576,wsize=1048576,intr,noatime,lock 0 0
10.50.251.36:/hana_log_backups_h80_sapprdhdb80_t020_xdp_rwclone_20200916_0256  /hana/log_backups/H80/01 nfs  rw,bg,hard,timeo=600,vers=4,rsize=1048576,wsize=1048576,intr,noatime,lock 0 0
*******************  HANA Test DR Restore Steps  ******************************
* Complete the following steps to recover your HANA database:           *
* 1. Ensure ALL the target mount points exist to mount the snapshot clones.    *
*    e.g. mkdir /hana/logbackups/H99_SOURCE                                    *
* 2. Add Mount Point Details from 'Displaying Mount Points by Volume' as       *
*    output above into /etc/fstab of DR Server.                                *
* 3. Mount newly added filesystems.                                            *
* 4. Perform HANA Snapshot Recovery using HANA Studio.                         *
********************************************************************************
*  These snapshot copies (clones) are kept for 4 weeks before                  *
*  being automatically removed.                                                *
*  Please contact Microsoft Operations to delete them earlier.                 *
********************************************************************************

重要

針對各種案例,「依磁片區顯示掛接點」輸出會有所不同。

執行完整 DR 容錯移轉 azacsnap -c restore --restore revertvolume

此命令 停止從主要月臺到次要月臺的儲存體複寫、還原 DR 磁片區上的最新快照集,並提供 DR 磁片區的掛接點。

此命令必須使用組態檔在 DR 伺服器上執行,且 DR.json 只有 DR 磁片區!

執行 命令 azacsnap -c restore --restore revertvolume 來執行容錯移轉至 DR 月臺。 此命令需要將 SID 新增為參數。 這是 HANA 實例的 SID,必須在 DR 月臺復原。

重要

只有在您打算執行 DR 練習或測試時,才執行此命令。 此命令會中斷複寫。 您必須連絡 Microsoft Operations 以重新啟用複寫。

概括而言,以下是執行 DR 容錯移轉的步驟:

  • 您必須關閉主要 月臺上的 HANA 實例。 只有當您真正執行容錯移轉至 DR 網站以避免資料不一致時,才需要此動作。
  • 關閉生產 SID 之 DR 節點上的 HANA 實例。
  • 使用要復原的 SID,在 DR 節點上執行 命令 azacsnap -c restore --restore revertvolume
    • 命令會中斷從主要月臺到 DR 網站的儲存體複寫連結
    • 此命令會還原已設定的「資料」和「其他」磁片區。 一般而言,這項作業適用于 /hana/data/hana/logbackups 檔案系統的磁片區。 /hana/shared檔案系統不會復原,而是使用 DR /hana/shared 位置的現有 SID。
    • 掛接 和 /hana/logbackups 磁片 /hana/data 區 – 確保它們已新增至 /etc/fstab 檔案
  • 還原 HANA SYSTEMDB 快照集。 HANA Studio 只會顯示在快照集命令 azacsnap -c restore --restore revertvolume 執行時還原的儲存體快照集下可用的最新 HANA 快照集。
  • 復原租使用者資料庫。
  • 在此案例中,于生產 SID 的 DR 網站上啟動 HANA 實例(例如:H80)。
  • 執行任何資料庫測試。

下一步