準備命令檔

您必須為切換和容錯移轉計畫中的特定動作,提供自訂命令檔給 Oracle Cloud Infrastructure Full Stack Disaster Recovery Service

關於複製 OCI 適用的 Oracle WebLogic Server 組態的命令檔

如果您使用 " OCI File Storage with rsync" 或 "Database File System (DBFS) " 方法和組態複製命令檔,將 Oracle WebLogic 網域複製到待命網站,則可以將它們新增為切換計畫的 "user step"。

附註:

這適用於以 " OCI File Storage with rsync" 和 "Database File System (DBFS) " 方法為基礎的災難復原模型,以進行組態複製。

此步驟不適用於以 Oracle Cloud Infrastructure Block Volumes 跨區域複本為基礎的災害復原模型。

如果您使用組態複製命令檔將「Oracle WebLogic 網域」複製到待命網站,可以將它們新增為切換計畫的使用者步驟。

如果待命資料庫中的 Oracle WebLogic 組態已經是主要資料庫的最新組態,則不需要執行它們。如果沒有,您可以在切換之前執行命令檔,從待命 Oracle WebLogic 網域中的主要資料庫取得最新的組態。

對於 Oracle WebLogic Server for OCIOracle SOA Suite on Marketplace 災害復原案例,您必須先在具有主要角色之網站的「管理」主機 0 中執行命令檔,然後在具有待命角色之網站的「管理」主機中執行命令檔。

如需瞭解此命令檔,請參閱 Oracle Cloud Infrastructure (OCI) 中的 Oracle WebLogic Server for Oracle Cloud Infrastructure,Disaster Recovery Production and DROracle Cloud Infrastructure Marketplace Disaster Recovery,Production and Disaster Recovery in the Oracle Cloud Infrastructure (OCI) 上的 SOA Suite

在「管理」主機中尋找命令檔的路徑。例如,/u01/scripts/config_replica.sh

關於更新資料庫連線字串的命令檔

如果您使用以 OCI 區塊磁碟區跨區域複本為基礎的災害復原模型,則必須在切換或容錯移轉作業之後,對 Oracle WebLogic 網域組態執行取代。
「Oracle WebLogic 網域」組態是主要組態的複本。因為 Oracle WebLogic 組態檔中的資料庫連線字串指向主要資料庫,所以您必須在切換或容錯移轉之後,將它取代為次要資料庫連線詳細資訊。相反地,如果有倒回或倒回。

附註:

此作業僅適用於以 OCI 區塊磁碟區跨區域複寫為基礎的災害復原模型。此作業不適用於以 rsync 和「資料庫檔案系統 (DBFS)」方法為基礎的「 OCI 檔案儲存 (含 rsync)」和「資料庫檔案系統 (DBFS)」方法進行組態複製的「災害復原」模型。

若要自動進行這項取代,請使用 replacement_script_BVmodel.sh 命令檔。This script is provided in Oracle WebLogic Server for Oracle Cloud Infrastructure, Disaster Recovery Production and DR in the Oracle Cloud Infrastructure (OCI) and SOA Suite on Oracle Cloud Infrastructure Marketplace Disaster Recovery, Production and Disaster Recovery in the Oracle Cloud Infrastructure (OCI) for the Block Volume cross-region DR model.您可以將此命令檔置於主要和待命資料庫的所有 WebLogic 節點,放入不在複製之區塊磁碟區中的資料夾中。您必須使用每個區域中的適當值來自訂程序檔。

在主機中尋找命令檔的路徑。例如,/u01/scripts/replacement_script_BVmodel.sh

當您定義切換與容錯移轉計畫時,會將此指令碼新增至計畫,作為使用者定義的步驟。

建立啟動和停止 Oracle WebLogic 處理作業的命令檔

建立要呼叫以停止並啟動 Oracle WebLogic 處理作業的自訂命令檔。如果您已經有自訂命令檔來停止並啟動 Oracle WebLogic 處理作業,就可以在 OCI Full Stack Disaster Recovery Service 計畫中使用這些命令檔。或者,您也可以使用下載程式碼段落中提供的 wls_stop.shwls_start.sh 命令檔。這些命令檔適用於 Oracle WebLogic Server for OCIOracle SOA Suite on Marketplace 。這些命令檔會分別啟動和停止所有 Oracle WebLogic 處理作業 (管理伺服器、受管理伺服器和節點管理程式) 或每個處理作業。

對於 OCI Full Stack Disaster Recovery Service 執行的切換和容錯移轉作業,Oracle 建議使用下列命令檔。這些範例命令檔會使用提供的 wls_stop.shwls_start.sh 命令檔 (使用特定選項呼叫它們),之後當您定義 DR 計畫時,將會從自訂計畫群組呼叫這些命令檔:

  1. 建立在中間層管理主機中啟動「Oracle WebLogic 管理」伺服器的命令檔。當節點管理程式停止時,它也會啟動它。
    下列是範例指令集:custom_start_aserver.sh。將此自訂命令檔放在中間層主機的資料夾中,例如 /opt/scripts。在 DR 計畫中會提供命令檔的完整路徑。
    # Remove .pid, .lck and .state files (that could have been left behind if a previous crash) before starting
    rm -f ${DOMAIN_HOME}/servers/*/data/nodemanager/*.lck
    rm -f ${DOMAIN_HOME}/servers/*/data/nodemanager/*.state
    rm -f ${DOMAIN_HOME}/servers/*/data/nodemanager/*.pid
    # Call to the script that starts the Node Manager (if not already up) and Admin server in this node
    /opt/scripts/restart/wls_start.sh aserver
  2. 建立命令檔,以在每個中間層主機中啟動 Oracle WebLogic 受管理伺服器。如果停止節點管理程式,也會啟動主機中的節點管理程式。
    下列是範例指令集:custom_start_mserver.sh。將此自訂命令檔放在中間層主機的資料夾中,例如 /opt/scripts。在 DR 計畫中會提供命令檔的完整路徑。
    # Remove .pid, .lck and .state files (that could have been left behind if a previous crash) before starting
    rm -f ${DOMAIN_HOME}/servers/*server_*/data/nodemanager/*.lck
    rm -f ${DOMAIN_HOME}/servers/*server_*/data/nodemanager/*.state
    rm -f ${DOMAIN_HOME}/servers/*server_*/data/nodemanager/*.pid
    # Call to the script that starts the Node Manager (if not already up) and managed server in this node
    /opt/scripts/restart/wls_start.sh mserver
  3. 建立命令檔來停止每個中間層主機中的 Oracle WebLogic 處理作業 (如果管理伺服器是管理主機和受管理伺服器的話)。節點管理程式將保留。
    下列是範例指令集:custom_stop.sh。將此自訂命令檔放在中間層主機的資料夾中,例如 /opt/scripts。在 DR 計畫中會提供命令檔的完整路徑。
    • 如果您使用 " OCI File Storage with rsync" 或 "Database File System (DBFS) " 方法來複製組態,則可以保持「節點管理程式」的正常運作。
      # Call to the script that stops WLS processes but leave the node manager up
      /opt/scripts/restart/wls_stop.sh servers
    • 如果您使用區塊磁碟區跨區域複本模型,則必須停止所有 WebLogic 伺服器相關處理作業,才能在切換期間卸載區塊磁碟區。停止 WebLogic 伺服器處理作業之後,您必須停止節點管理程式處理作業。請在 custom_stop.sh 程序檔中使用下列內容:
      # Call to the script that stops WLS processes and node manager in this host
      /opt/scripts/restart/wls_stop.sh all

建立命令檔以變更 DNS 前端名稱

您可以新增自訂計畫群組和步驟來自動變更 DNS,以變更 DNS 提供者中的前端 DNS 記錄。

如果您使用的是 Oracle Cloud Infrastructure DNS,則此文件的下載指令碼區段中有適用的指令碼範例。

  • 切換至「區域 2」時,您必須執行將前端名稱 DNS 記錄更新為指向「區域 2」之負載平衡器的 IP 的命令檔。將此命令檔置於 Region 2 中間層主機的其中一個。
  • 切換至「區域 1」時,請執行將前端名稱 DNS 記錄更新為指向「區域 1」之負載平衡器的 IP 的命令檔。將此命令碼置於 Region 1 中間層主機之一。
  • 或者,您可以在每個以無伺服器模式執行適當命令檔的網站中,建立 Oracle Cloud Infrastructure 函數。

識別其他自訂程序檔

識別並找出在執行切換或容錯移轉作業時,需要在系統中執行的任何其他命令檔。當您定義災害復原計畫時,系統會從您的自訂計畫群組呼叫這些命令檔。