針對 SAP 應用程式使用 Azure NetApp Files 在 SUSE Linux Enterprise Server 上的 Azure VM 達到 SAP NetWeaver 高可用性

本文說明如何使用 Azure NetApp Files 設定 SAP NetWeaver 應用程式的高可用性。

針對 SLES for SAP Applications 15 的新實作,建議您在簡單的掛接設定中部署 SAP ASCS/ERS 的高可用性。 根據 SAP 中央服務目錄 的叢集控制檔系統,仍支援傳統 Pacemaker 設定。

在範例組態、安裝命令等中,ASCS 實例是數位 00、ERS 實例號碼 01、主要應用程式實例 (PAS) 為 02,而應用程式實例 (AAS) 為 03。 使用 SAP 系統識別碼 QAS。 本文並未詳細說明資料庫層。

請先閱讀下列 SAP 附註和檔案:

概觀

SAP Netweaver 中央服務的高可用性(HA)需要共用記憶體。 若要在 SUSE Linux 上達到此目的,您必須建置個別高可用性 NFS 叢集。

現在可以使用部署在 Azure NetApp Files 上的共用記憶體來達成 SAP Netweaver HA。 針對共用記憶體使用 Azure NetApp Files 可免除額外的 NFS 叢集需求。 SAP Netweaver 中央服務的 HA 仍需要 Pacemaker(ASCS/SCS)。

SAP NetWeaver High Availability overview

SAP NetWeaver ASCS、SAP NetWeaver SCS、SAP NetWeaver ERS 和 SAP HANA 資料庫會使用虛擬主機名和虛擬 IP 位址。 在 Azure 上, 需要使用虛擬 IP 位址的負載平衡器 。 我們建議使用 標準負載平衡器。 呈現的組態會顯示負載平衡器,其中包含:

  • 適用於 ASCS 的前端 IP 位址 10.1.1.20
  • ERS 前端IP位址 10.1.1.21
  • ASCS 的探查埠 62000
  • ERS 的探查埠 62101

設定 Azure NetApp Files 基礎結構

SAP NetWeaver 需要傳輸和設定檔目錄的共享記憶體。 繼續進行 Azure NetApp 檔案基礎結構的設定之前,請先 熟悉 Azure NetApp Files 檔。 檢查您選取的 Azure 區域是否提供 Azure NetApp Files。 下列連結顯示依 Azure 區域的 Azure NetApp Files 可用性: Azure 區域的 Azure NetApp Files 可用性。

Azure NetApp 檔案可在數 個 Azure 區域中使用。

部署 Azure NetApp Files 資源

這些步驟假設您已部署 Azure 虛擬網絡。 Azure NetApp Files 資源和 VM,其中 Azure NetApp Files 資源必須部署在相同的 Azure 虛擬網絡 或對等互連 Azure 虛擬網絡 中。

  1. 遵循建立 NetApp 帳戶的指示, 在選取的 Azure 區域中建立 NetApp 帳戶
  2. 依照如何設定 Azure NetApp Files 容量集區的指示設定 Azure NetApp Files 容量集
    本文所呈現的 SAP Netweaver 架構會使用單一 Azure NetApp Files 容量集區,進階版 SKU。 我們建議在 Azure 上針對 SAP Netweaver 應用程式工作負載使用 Azure NetApp Files 進階版 SKU。
  3. 將子網委派給 Azure NetApp 檔案,如將子網委派給 Azure NetApp Files 中的指示所述
  4. 遵循為 Azure NetApp Files 建立磁碟區的指示, 部署 Azure NetApp Files 磁碟區。 在指定的 Azure NetApp Files 子網中部署磁碟區。 Azure NetApp 磁碟區的IP位址會自動指派。 請記住,Azure NetApp Files 資源和 Azure VM 必須位於相同的 Azure 虛擬網絡 或對等互連 Azure 虛擬網絡 中。 在此範例中,我們使用兩個 Azure NetApp Files 磁碟區:sapQAS 和 trans。掛接至對應裝入點的檔案路徑為 /usrsapqas/sapmntQAS、/usrsap qas/usrsapQASsys 等。
    1. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/sapmntQAS
    2. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/usrsapQASascs)
    3. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/usrsapQASsys)
    4. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/usrsapQASers)
    5. 音量跨量 (nfs://10.1.0.4/trans)
    6. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/usrsapQASpas)
    7. 磁碟區 sapQAS (nfs://10.1.0.4/usrsapqas/usrsapQASaas)

在此範例中,我們針對所有 SAP Netweaver 文件系統使用 Azure NetApp Files 來示範如何使用 Azure NetApp Files。 不需要透過 NFS 掛接的 SAP 檔案系統也可以部署為 Azure 磁碟記憶體 。 在此範例中,a-e 必須位於 Azure NetApp Files 和 f-g 上(也就是 /usr/sap/QAS/D 02、/usr/sap/QAS/D03)可以部署為 Azure 磁碟記憶體。

重要考量

考慮 SUSE 高可用性架構上 SAP Netweaver 的 Azure NetApp Files 時,請注意下列重要考慮:

  • 最小容量集區為 4 TiB。 容量集區大小可以以 1 TiB 增量增加。
  • 最小磁碟區為100 GiB
  • Azure NetApp Files 和將掛接 Azure NetApp Files 磁碟區的所有虛擬機都必須位於相同的 Azure 虛擬網絡 或相同區域中的對等互連虛擬網路中。 現在支援透過相同區域中 VNET 對等互連的 Azure NetApp Files 存取。 尚不支援透過全域對等互連的 Azure NetApp 存取。
  • 選取的虛擬網路必須具有已委派給 Azure NetApp Files 的子網路。
  • Azure NetApp Files 磁碟區的輸送量和效能特性是磁碟區配額和服務等級的功能,如 Azure NetApp Files 的服務等級中所述。 調整 SAP Azure NetApp 磁碟區的大小時,請確定產生的輸送量符合應用程式需求。
  • Azure NetApp Files 提供 導出原則:您可以控制允許的用戶端、存取類型(可擦寫、只讀等)。
  • Azure NetApp Files 功能尚不會感知區域。 目前 Azure NetApp Files 功能不會部署在 Azure 區域的所有可用性區域中。 請注意部分 Azure 區域中的潛在延遲影響。
  • Azure NetApp Files 磁碟區可以部署為 NFSv3 或 NFSv4.1 磁碟區。 SAP 應用層支援這兩種通訊協定(ASCS/ERS、SAP 應用程式伺服器)。

準備基礎結構

SAP 實例的資源代理程式包含在 SUSE Linux Enterprise Server for SAP Applications 中。 Azure Marketplace 提供適用於 SAP 應用程式 12 或 15 的 SUSE Linux Enterprise Server 映射。 您可以使用映像來部署新的 VM。

透過 Azure 入口網站 手動部署Linux VM

本檔假設您已部署資源群組、Azure 虛擬網絡 和子網。

使用 SLES for SAP Applications 映像部署虛擬機。 選擇 SAP 系統支援的適當 SLES 映像版本。 您可以在任一可用性選項中部署 VM - 虛擬機擴展集、可用性區域或可用性設定組。

設定 Azure 負載平衡器

在 VM 設定期間,您可以選擇在網路區段中建立或選取結束的負載平衡器。 請遵循下列步驟來設定標準負載平衡器,以設定SAP ASCS和SCS的高可用性設定。

請遵循建立負載平衡器指南,使用 Azure 入口網站 為高可用性 SAP 系統設定標準負載平衡器。 在設定負載平衡器期間,請考慮下列幾點。

  1. 前端IP組態: 建立兩個前端IP,一個用於ASCS,另一個用於ERS。 選取與您 ASCS/ERS 虛擬機相同的虛擬網路和子網。
  2. 後端集區: 建立後端集區,並新增 ASCS 和 ERS VM。
  3. 輸入規則: 建立兩個負載平衡規則,一個用於 ASCS,另一個用於 ERS。 針對這兩個負載平衡規則,請遵循相同的步驟。
    • 前端IP位址:選取前端IP
    • 後端集區:選取後端集區
    • 檢查「高可用性埠」
    • 通訊協定:TCP
    • 健康情況探查:使用下列詳細數據建立健康情況探查(適用於 ASCS 或 ERS)
      • 通訊協定:TCP
      • 埠:[例如:620<實例否。> 適用於 ASCS,621<實例否。> ERS]
      • 間隔:5
      • 探查臨界值:2
    • 閑置逾時(分鐘):30
    • 檢查 [啟用浮動 IP]

注意

健康情況探查組態屬性 numberOfProbes,否則在入口網站中稱為「狀況不良閾值」,則不會受到尊重。 因此,若要控制連續探查成功或失敗的數目,請將屬性 “probeThreshold” 設定為 2。 目前無法使用 Azure 入口網站 來設定此屬性,因此請使用 Azure CLIPowerShell 命令。

重要

負載平衡案例中的 NIC 次要IP組態不支援浮動IP。 如需詳細資訊,請參閱 Azure Load Balancer 限制。 如果您需要 VM 的其他 IP 位址,請部署第二個 NIC。

注意

當沒有公用IP位址的VM放置在內部(無公用IP位址)標準 Azure 負載平衡器的後端集區時,除非執行其他設定以允許路由傳送至公用端點,否則不會有輸出因特網連線能力。 如需如何達成輸出連線的詳細資訊,請參閱在 SAP 高可用性案例中使用 Azure Standard Load Balancer 虛擬機器 的公用端點連線。

重要

  • 請勿在位於 Azure Load Balancer 後方的 Azure VM 上啟用 TCP 時間戳。 啟用 TCP 時間戳記會導致健康狀態探查失敗。 將 net.ipv4.tcp_timestamps 參數設定為 0。 如需詳細資訊,請參閱 Load Balancer健康情況探查。
  • 若要防止 saptune 將手動設定 net.ipv4.tcp_timestamps 的值 0 從 變更回 1,您應該將 saptune 版本更新為 3.1.1 或更高版本。 如需詳細資訊,請參閱 saptune 3.1.1 – 我需要更新嗎?

停用識別碼對應(如果使用 NFSv4.1)

如果搭配使用 Azure NetApp Files 磁碟區搭配 NFSv4.1 通訊協定,本節中的指示才適用。 在所有 VM 上執行設定,其中會掛接 Azure NetApp Files NFSv4.1 磁碟區。

  1. 確認 NFS 網域設定。 請確定網域已設定為預設的 Azure NetApp Files 網域, defaultv4iddomain.com 且對應設定為 沒有人

    重要

    請務必在 VM 上設定 NFS 網域 /etc/idmapd.conf ,以符合 Azure NetApp Files 上的預設網域組態: defaultv4iddomain.com。 如果 NFS 用戶端上的網域設定與 NFS 伺服器之間不符,亦即 Azure NetApp 設定,則 VM 上掛接之 Azure NetApp 磁碟區上的檔案權限會顯示為 nobody

    sudo cat /etc/idmapd.conf
    
    # Example
    [General]
    Verbosity = 0
    Pipefs-Directory = /var/lib/nfs/rpc_pipefs
    Domain = defaultv4iddomain.com
    [Mapping]
    Nobody-User = nobody
    Nobody-Group = nobody
    
  2. [A] 驗證 nfs4_disable_idmapping。 它應該設定為 Y。若要建立所在的 nfs4_disable_idmapping 目錄結構,請執行掛接命令。 您無法在 /sys/modules 下手動建立目錄,因為存取權會保留給核心 /驅動程式。

    # Check nfs4_disable_idmapping 
    cat /sys/module/nfs/parameters/nfs4_disable_idmapping
    
    # If you need to set nfs4_disable_idmapping to Y
    mkdir /mnt/tmp
    mount 10.1.0.4:/sapmnt/qas /mnt/tmp
    umount  /mnt/tmp
    echo "Y" > /sys/module/nfs/parameters/nfs4_disable_idmapping
    
    # Make the configuration permanent
    echo "options nfs nfs4_disable_idmapping=Y" >> /etc/modprobe.d/nfs.conf
    

設定 (A)SCS

接下來,您將準備並安裝 SAP ASCS 和 ERS 實例。

建立 Pacemaker 叢集

請遵循在 Azure 中的 SUSE Linux Enterprise Server 上設定 Pacemaker 中的步驟,為此 (A)SCS 伺服器建立基本的 Pacemaker 叢集。

安裝

下列專案前面 加上 [A] - 適用於所有節點 [ 1] - 僅適用於節點 1 或 [2] - 僅適用於節點 2。

  1. [A] 安裝 SUSE 連線 or

    sudo zypper install sap-suse-cluster-connector
    

    注意

    在主機名中使用破折號的已知問題已修正為套件 sap-suse-cluster-connector 3.1.1 版。 如果使用主機名中有虛線的叢集節點,請確定您至少使用套件 sap-suse-cluster-connector 3.1.1 版。 否則,您的叢集將無法運作。

    請確定您已安裝新版的 SAP SUSE 叢集連接器。 舊的稱為sap_suse_cluster_connector,新的稱為 sap-suse-cluster-connector

    sudo zypper info sap-suse-cluster-connector
    
    # Information for package sap-suse-cluster-connector:
    # ---------------------------------------------------
    # Repository     : SLE-12-SP3-SAP-Updates
    # Name           : sap-suse-cluster-connector
    # Version        : 3.1.0-8.1
    # Arch           : noarch
    # Vendor         : SUSE LLC <https://www.suse.com/>
    # Support Level  : Level 3
    # Installed Size : 45.6 KiB
    # Installed      : Yes
    # Status         : up-to-date
    # Source package : sap-suse-cluster-connector-3.1.0-8.1.src
    # Summary        : SUSE High Availability Setup for SAP Products
    
  2. [A] 更新 SAP 資源代理程式

    需要資源代理程式套件的修補程式,才能使用本文所述的新組態。 您可以使用下列命令來檢查修補程式是否已安裝

    sudo grep 'parameter name="IS_ERS"' /usr/lib/ocf/resource.d/heartbeat/SAPInstance
    

    輸出應該類似

    <parameter name="IS_ERS" unique="0" required="0">
    

    如果 grep 命令找不到 IS_ERS 參數,您必須安裝 SUSE 下載頁面上所列的修補程式

    # example for patch for SLES 12 SP1
    sudo zypper in -t patch SUSE-SLE-HA-12-SP1-2017-885=1
    
    # example for patch for SLES 12 SP2
    sudo zypper in -t patch SUSE-SLE-HA-12-SP2-2017-886=1
    
  3. [A] 安裝程式主機名解析

    您可以使用 DNS 伺服器,或修改所有節點上的 /etc/hosts。 此範例示範如何使用 /etc/hosts 檔案。 在下列命令中取代IP位址和主機名

    sudo vi /etc/hosts
    

    將下列幾行插入 /etc/hosts。 變更IP位址和主機名以符合您的環境

    # IP address of cluster node 1
    10.1.1.18    anftstsapcl1
    # IP address of cluster node 2
    10.1.1.6     anftstsapcl2
    # IP address of the load balancer frontend configuration for SAP Netweaver ASCS
    10.1.1.20    anftstsapvh
    # IP address of the load balancer frontend configuration for SAP Netweaver ERS
    10.1.1.21    anftstsapers
    
  4. [1] 在 Azure NetApp Files 磁碟區中建立 SAP 目錄。

    在其中一個 VM 上暫時掛接 Azure NetApp Files 磁碟區,並建立 SAP 目錄(檔案路徑)。

    # mount temporarily the volume
    sudo mkdir -p /saptmp
    # If using NFSv3
    sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,nfsvers=3,tcp 10.1.0.4:/sapQAS /saptmp
    # If using NFSv4.1
    sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,nfsvers=4.1,sec=sys,tcp 10.1.0.4:/sapQAS /saptmp
    # create the SAP directories
    sudo cd /saptmp
    sudo mkdir -p sapmntQAS
    sudo mkdir -p usrsapQASascs
    sudo mkdir -p usrsapQASers
    sudo mkdir -p usrsapQASsys
    sudo mkdir -p usrsapQASpas
    sudo mkdir -p usrsapQASaas
    # unmount the volume and delete the temporary directory
    sudo cd ..
    sudo umount /saptmp
    sudo rmdir /saptmp
    

準備 SAP NetWeaver 安裝

  1. [A] 建立共享目錄

    sudo mkdir -p /sapmnt/QAS
    sudo mkdir -p /usr/sap/trans
    sudo mkdir -p /usr/sap/QAS/SYS
    sudo mkdir -p /usr/sap/QAS/ASCS00
    sudo mkdir -p /usr/sap/QAS/ERS01
    
    sudo chattr +i /sapmnt/QAS
    sudo chattr +i /usr/sap/trans
    sudo chattr +i /usr/sap/QAS/SYS
    sudo chattr +i /usr/sap/QAS/ASCS00
    sudo chattr +i /usr/sap/QAS/ERS01
    
  2. [A] 設定 autofs

    sudo vi /etc/auto.master
    
    # Add the following line to the file, save and exit
    /- /etc/auto.direct
    

    如果使用 NFSv3,請使用下列專案建立檔案:

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=3,nobind 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=3,nobind 10.1.0.4:/trans
    /usr/sap/QAS/SYS -nfsvers=3,nobind 10.1.0.4:/usrsapqas/usrsapQASsys
    

    如果使用 NFSv4.1,請使用下列專案建立檔案:

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/trans
    /usr/sap/QAS/SYS -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/usrsapQASsys
    

    注意

    掛接磁碟區時,請務必符合 Azure NetApp Files 磁碟區的 NFS 通訊協定版本。 如果 Azure NetApp Files 磁碟區建立為 NFSv3 磁碟區,請使用對應的 NFSv3 組態。 如果 Azure NetApp Files 磁碟區建立為 NFSv4.1 磁碟區,請遵循指示來停用標識符對應,並確定使用對應的 NFSv4.1 設定。 在此範例中,Azure NetApp Files 磁碟區會建立為 NFSv3 磁碟區。

    重新啟動 autofs 以掛接新的共用

    sudo systemctl enable autofs
    sudo service autofs restart
    
  3. [A] 設定 SWAP 檔案

    sudo vi /etc/waagent.conf
    
    # Check if property ResourceDisk.Format is already set to y and if not, set it
    ResourceDisk.Format=y
    
    # Set the property ResourceDisk.EnableSwap to y
    # Create and use swapfile on resource disk.
    ResourceDisk.EnableSwap=y
    
    # Set the size of the SWAP file with property ResourceDisk.SwapSizeMB
    # The free space of resource disk varies by virtual machine size. Make sure that you do not set a value that is too big. You can check the SWAP space with command swapon
    # Size of the swapfile.
    ResourceDisk.SwapSizeMB=2000
    

    重新啟動代理程式以啟用變更

    sudo service waagent restart
    

安裝 SAP NetWeaver ASCS/ERS

  1. [1] 建立 ASCS 實例的虛擬IP資源和健康情況探查

    重要

    最近的測試顯示,netcat 因待處理專案而停止回應要求的情況,以及只處理一個連線的限制。 netcat 資源會停止接聽 Azure Load Balancer 要求,而浮動 IP 變成無法使用。
    針對現有的 Pacemaker 叢集,我們過去建議使用 socat 取代 netcat。 目前,建議您使用屬於套件資源代理程式的 azure-lb 資源代理程式,並符合下列套件版本需求:

    • 針對 SLES 12 SP4/SP5,版本至少必須是 resource-agents-4.3.018.a7fb5035-3.30.1。
    • 針對 SLES 15/15 SP1,版本至少必須是 resource-agents-4.3.0184.6ee15eb2-4.13.1。

    請注意,變更需要短暫的停機時間。
    針對現有的 Pacemaker 叢集,如果設定已變更為使用 socat,如 Azure Load-Balancer 偵測強化中所述,就不需要立即切換至 azure-lb 資源代理程式。

    sudo crm node standby anftstsapcl2
    
    # If using NFSv3
    sudo crm configure primitive fs_QAS_ASCS Filesystem device='10.1.0.4/usrsapqas/usrsapQASascs' directory='/usr/sap/QAS/ASCS00' fstype='nfs' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=40s
    
    # If using NFSv4.1
    sudo crm configure primitive fs_QAS_ASCS Filesystem device='10.1.0.4:/usrsapqas/usrsapQASascs' directory='/usr/sap/QAS/ASCS00' fstype='nfs' options='sec=sys,nfsvers=4.1' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=105s
    
    sudo crm configure primitive vip_QAS_ASCS IPaddr2 \
      params ip=10.1.1.20 \
      op monitor interval=10 timeout=20
    
    sudo crm configure primitive nc_QAS_ASCS azure-lb port=62000 \
      op monitor timeout=20s interval=10
    
    sudo crm configure group g-QAS_ASCS fs_QAS_ASCS nc_QAS_ASCS vip_QAS_ASCS \
       meta resource-stickiness=3000
    

    請確定叢集狀態良好,且所有資源都已啟動。 資源執行所在的節點上並不重要。

    sudo crm_mon -r
    
    # Node anftstsapcl2: standby
    # Online: [ anftstsapcl1 ]
    # 
    # Full list of resources:
    #
    # Resource Group: g-QAS_ASCS
    #     fs_QAS_ASCS        (ocf::heartbeat:Filesystem):    Started anftstsapcl1
    #     nc_QAS_ASCS        (ocf::heartbeat:azure-lb):      Started anftstsapcl1
    #     vip_QAS_ASCS       (ocf::heartbeat:IPaddr2):       Started anftstsapcl1
    # stonith-sbd     (stonith:external/sbd): Started anftstsapcl2
    
  2. [1] 安裝 SAP NetWeaver ASCS

    使用對應至 ASCS 之負載平衡器前端設定 IP 位址的虛擬主機名,將 SAP NetWeaver ASCS 安裝為根目錄,例如 anftstsapvh10.1.1.20 ,以及您用於探查負載平衡器的實例編號,例如 00

    您可以使用 sapinst 參數SAPINST_REMOTE_ACCESS_USER來允許非根用戶連線到 sapinst。 您可以使用參數SAPINST_USE_HOSTNAME,使用虛擬主機名來安裝SAP。

    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin SAPINST_USE_HOSTNAME=virtual_hostname
    

    如果安裝無法在 /usr/sap/QAS/ASCS00 中建立子資料夾,請嘗試設定 ASCS00 資料夾的擁有者和群組,然後重試。

    chown qasadm /usr/sap/QAS/ASCS00
    chgrp sapsys /usr/sap/QAS/ASCS00
    
  3. [1] 建立 ERS 實例的虛擬IP資源和健康情況探查。

    sudo crm node online anftstsapcl2
    sudo crm node standby anftstsapcl1
    
    # If using NFSv3
    sudo crm configure primitive fs_QAS_ERS Filesystem device='10.1.0.4:/usrsapqas/usrsapQASers' directory='/usr/sap/QAS/ERS01' fstype='nfs' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=40s
    
    # If using NFSv4.1
    sudo crm configure primitive fs_QAS_ERS Filesystem device='10.1.0.4:/usrsapqas/usrsapQASers' directory='/usr/sap/QAS/ERS01' fstype='nfs' options='sec=sys,nfsvers=4.1' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=105s
    
    sudo crm configure primitive vip_QAS_ERS IPaddr2 \
      params ip=10.1.1.21 \
      op monitor interval=10 timeout=20
    
    sudo crm configure primitive nc_QAS_ERS azure-lb port=62101 \
      op monitor timeout=20s interval=10
    
    sudo crm configure group g-QAS_ERS fs_QAS_ERS nc_QAS_ERS vip_QAS_ERS
    

    請確定叢集狀態良好,且所有資源都已啟動。 資源執行所在的節點上並不重要。

    sudo crm_mon -r
    
    # Node anftstsapcl1: standby
    # Online: [ anftstsapcl2 ]
    # 
    # Full list of resources:
    #
    # stonith-sbd     (stonith:external/sbd): Started anftstsapcl2
    #  Resource Group: g-QAS_ASCS
    #      fs_QAS_ASCS        (ocf::heartbeat:Filesystem):    Started anftstsapcl2
    #      nc_QAS_ASCS        (ocf::heartbeat:azure-lb):      Started anftstsapcl2
    #      vip_QAS_ASCS       (ocf::heartbeat:IPaddr2):       Started anftstsapcl2
    #  Resource Group: g-QAS_ERS
    #      fs_QAS_ERS (ocf::heartbeat:Filesystem):    Started anftstsapcl2
    #      nc_QAS_ERS (ocf::heartbeat:azure-lb):      Started anftstsapcl2
    #      vip_QAS_ERS  (ocf::heartbeat:IPaddr2):     Started anftstsapcl2
    
  4. [2] 安裝 SAP NetWeaver ERS

    使用對應至 ERS 之負載平衡器前端設定 IP 位址的虛擬主機名,將 SAP NetWeaver ERS 安裝為根目錄,例如10.1.1.21,以及您用於負載平衡器探查的實例編號,例如 01

    您可以使用 sapinst 參數SAPINST_REMOTE_ACCESS_USER來允許非根用戶連線到 sapinst。 您可以使用參數SAPINST_USE_HOSTNAME,使用虛擬主機名來安裝SAP。

    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin SAPINST_USE_HOSTNAME=virtual_hostname
    

    注意

    使用 SWPM SP 20 PL 05 或更高版本。 較低版本未正確設定許可權,安裝將會失敗。

    如果安裝無法在 /usr/sap/QAS/ERS01 中建立子資料夾,請嘗試設定 ERS01 資料夾的擁有者和群組,然後重試。

    chown qasadm /usr/sap/QAS/ERS01
    chgrp sapsys /usr/sap/QAS/ERS01
    
  5. [1] 調整 ASCS/SCS 和 ERS 實例配置檔

    • ASCS/SCS 設定檔

      sudo vi /sapmnt/QAS/profile/QAS_ASCS00_anftstsapvh
      
      # Change the restart command to a start command
      #Restart_Program_01 = local $(_EN) pf=$(_PF)
      Start_Program_01 = local $(_EN) pf=$(_PF)
      
      # Add the following lines
      service/halib = $(DIR_CT_RUN)/saphascriptco.so
      service/halib_cluster_connector = /usr/bin/sap_suse_cluster_connector
      
      # Add the keep alive parameter, if using ENSA1
      enque/encni/set_so_keepalive = true
      

      針對 ENSA1 和 ENSA2,請確定 keepalive OS 參數已設定為 SAP 附注 1410736中所述。

    • ERS 配置檔

      sudo vi /sapmnt/QAS/profile/QAS_ERS01_anftstsapers
      
      # Change the restart command to a start command
      #Restart_Program_00 = local $(_ER) pf=$(_PFL) NR=$(SCSID)
      Start_Program_00 = local $(_ER) pf=$(_PFL) NR=$(SCSID)
      
      # Add the following lines
      service/halib = $(DIR_CT_RUN)/saphascriptco.so
      service/halib_cluster_connector = /usr/bin/sap_suse_cluster_connector
      
      # remove Autostart from ERS profile
      # Autostart = 1
      
  6. [A] 設定保持運作

    SAP NetWeaver 應用程式伺服器與 ASCS/SCS 之間的通訊會透過軟體負載平衡器路由傳送。 負載平衡器在可設定的逾時之後中斷非使用中聯機。 若要避免這種情況,您必須在 SAP NetWeaver ASCS/SCS 配置檔中設定參數,如果使用 ENSA1,並在 ENSA1/ENSA2 的所有 SAP 伺服器上變更 Linux 系統 keepalive 設定。 如需詳細資訊,請參閱 SAP 附注1410736。

    # Change the Linux system configuration
    sudo sysctl net.ipv4.tcp_keepalive_time=300
    
  7. [A] 安裝之後設定 SAP 使用者

    # Add sidadm to the haclient group
    sudo usermod -aG haclient qasadm
    
  8. [1] 將 ASCS 和 ERS SAP 服務新增至 sapservice 檔案

    將 ASCS 服務專案新增至第二個節點,並將 ERS 服務專案複製到第一個節點。

    cat /usr/sap/sapservices | grep ASCS00 | sudo ssh anftstsapcl2 "cat >>/usr/sap/sapservices"
    sudo ssh anftstsapcl2 "cat /usr/sap/sapservices" | grep ERS01 | sudo tee -a /usr/sap/sapservices
    
  9. [1] 建立 SAP 叢集資源。

    視您執行 ENSA1 或 ENSA2 系統而定,選取個別索引標籤來定義資源。 SAP 在 SAP NetWeaver 7.52 中引進了 ENSA2 的支援,包括複寫。 從 ABAP Platform 1809 開始,預設會安裝 ENSA2。 如需 ENSA2 支援,請參閱 SAP 附注 2630416

    sudo crm configure property maintenance-mode="true"
    
    # If using NFSv3
    sudo crm configure primitive rsc_sap_QAS_ASCS00 SAPInstance \
        operations \$id=rsc_sap_QAS_ASCS00-operations \
        op monitor interval=11 timeout=60 on-fail=restart \
        params InstanceName=QAS_ASCS00_anftstsapvh START_PROFILE="/sapmnt/QAS/profile/QAS_ASCS00_anftstsapvh" \
        AUTOMATIC_RECOVER=false \
        meta resource-stickiness=5000 failure-timeout=60 migration-threshold=1 priority=10
    
    # If using NFSv4.1
    sudo crm configure primitive rsc_sap_QAS_ASCS00 SAPInstance \
        operations \$id=rsc_sap_QAS_ASCS00-operations \
        op monitor interval=11 timeout=105 on-fail=restart \
        params InstanceName=QAS_ASCS00_anftstsapvh START_PROFILE="/sapmnt/QAS/profile/QAS_ASCS00_anftstsapvh" \
        AUTOMATIC_RECOVER=false \
        meta resource-stickiness=5000 failure-timeout=105 migration-threshold=1 priority=10
    
    # If using NFSv3   
    sudo crm configure primitive rsc_sap_QAS_ERS01 SAPInstance \
        operations \$id=rsc_sap_QAS_ERS01-operations \
        op monitor interval=11 timeout=60 on-fail=restart \
        params InstanceName=QAS_ERS01_anftstsapers START_PROFILE="/sapmnt/QAS/profile/QAS_ERS01_anftstsapers" AUTOMATIC_RECOVER=false IS_ERS=true \
        meta priority=1000
    
    # If using NFSv4.1
    sudo crm configure primitive rsc_sap_QAS_ERS01 SAPInstance \
        operations \$id=rsc_sap_QAS_ERS01-operations \
        op monitor interval=11 timeout=105 on-fail=restart \
        params InstanceName=QAS_ERS01_anftstsapers START_PROFILE="/sapmnt/QAS/profile/QAS_ERS01_anftstsapers" AUTOMATIC_RECOVER=false IS_ERS=true \
        meta priority=1000
    
    sudo crm configure modgroup g-QAS_ASCS add rsc_sap_QAS_ASCS00
    sudo crm configure modgroup g-QAS_ERS add rsc_sap_QAS_ERS01
    
    sudo crm configure colocation col_sap_QAS_no_both -5000: g-QAS_ERS g-QAS_ASCS
    sudo crm configure location loc_sap_QAS_failover_to_ers rsc_sap_QAS_ASCS00 rule 2000: runs_ers_QAS eq 1
    sudo crm configure order ord_sap_QAS_first_start_ascs Optional: rsc_sap_QAS_ASCS00:start rsc_sap_QAS_ERS01:stop symmetrical=false
    
    sudo crm_attribute --delete --name priority-fencing-delay
    
    sudo crm node online anftstsapcl1
    sudo crm configure property maintenance-mode="false"
    

如果您要從舊版升級並切換至加入佇列伺服器 2,請參閱 SAP 附注 2641019

注意

使用 NFSv4.1 時建議的較高逾時,由於通訊協定特定的暫停,與 NFSv4.1 租用更新相關。 如需詳細資訊,請參閱 NetApp 最佳做法中的 NFS。

上述組態中的逾時可能需要調整為特定的 SAP 設定。

請確定叢集狀態良好,且所有資源都已啟動。 資源執行所在的節點上並不重要。

sudo crm_mon -r
  
# Full list of resources:
#
# stonith-sbd     (stonith:external/sbd): Started anftstsapcl2
#  Resource Group: g-QAS_ASCS
#      fs_QAS_ASCS        (ocf::heartbeat:Filesystem):    Started anftstsapcl1
#      nc_QAS_ASCS        (ocf::heartbeat:azure-lb):      Started anftstsapcl1
#      vip_QAS_ASCS       (ocf::heartbeat:IPaddr2):       Started anftstsapcl1
#      rsc_sap_QAS_ASCS00 (ocf::heartbeat:SAPInstance):   Started anftstsapcl1
#  Resource Group: g-QAS_ERS
#      fs_QAS_ERS (ocf::heartbeat:Filesystem):    Started anftstsapcl2
#      nc_QAS_ERS (ocf::heartbeat:azure-lb):      Started anftstsapcl2
#      vip_QAS_ERS        (ocf::heartbeat:IPaddr2):       Started anftstsapcl2
#      rsc_sap_QAS_ERS01  (ocf::heartbeat:SAPInstance):   Started anftstsapcl2

SAP NetWeaver 應用程式伺服器準備

某些資料庫要求在應用程式伺服器上執行資料庫實例安裝。 準備應用程式伺服器虛擬機,以在這些情況下使用它們。

這些步驟假設您在與 ASCS/SCS 和 HANA 伺服器不同的伺服器上安裝應用程式伺服器。 否則,不需要下列一些步驟(例如設定主機名解析)。

下列專案前面加上 [ A] - 適用於 PAS 和 AAS、 [P] - 僅適用於 PAS 或 [S] - 僅適用於 AAS。

  1. [A] 設定作業系統

    縮減已變更的快取大小。 如需詳細資訊,請參閱 SLES 11/12 伺服器上具有大型 RAM 的低寫入效能。

    sudo vi /etc/sysctl.conf
    
    # Change/set the following settings
    vm.dirty_bytes = 629145600
    vm.dirty_background_bytes = 314572800
    
  2. [A] 安裝程式主機名解析

    您可以使用 DNS 伺服器,或修改所有節點上的 /etc/hosts。 此範例示範如何使用 /etc/hosts 檔案。 在下列命令中取代IP位址和主機名

    sudo vi /etc/hosts
    

    將下列幾行插入 /etc/hosts。 變更IP位址和主機名以符合您的環境

    # IP address of the load balancer frontend configuration for SAP NetWeaver ASCS/SCS
    10.1.1.20 anftstsapvh
    # IP address of the load balancer frontend configuration for SAP NetWeaver ERS
    10.1.1.21 anftstsapers
    # IP address of all application servers
    10.1.1.15 anftstsapa01
    10.1.1.16 anftstsapa02
    
  3. [A] 建立 sapmnt 目錄

    sudo mkdir -p /sapmnt/QAS
    sudo mkdir -p /usr/sap/trans
    
    sudo chattr +i /sapmnt/QAS
    sudo chattr +i /usr/sap/trans
    
  4. [P] 建立 PAS 目錄

    sudo mkdir -p /usr/sap/QAS/D02
    sudo chattr +i /usr/sap/QAS/D02
    
  5. [S] 建立 AAS 目錄

    sudo mkdir -p /usr/sap/QAS/D03
    sudo chattr +i /usr/sap/QAS/D03
    
  6. [P]autofs 在 PAS 上設定

    sudo vi /etc/auto.master
    
    # Add the following line to the file, save and exit
    /- /etc/auto.direct
    

    如果使用 NFSv3,請使用下列專案建立新的檔案:

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=3,nobind 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=3,nobind 10.1.0.4:/trans
    /usr/sap/QAS/D02 -nfsvers=3,nobind 10.1.0.4:/usrsapqas/usrsapQASpas
    

    如果使用 NFSv4.1,請使用下列專案建立新的檔案:

    sudo vi /etc/auto.direct
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/trans
    /usr/sap/QAS/D02 -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/usrsapQASpas
    

    重新啟動 autofs 以掛接新的共用

    sudo systemctl enable autofs
    sudo service autofs restart
    
  7. [P] 在 AAS 上設定autofs

    sudo vi /etc/auto.master
    
    # Add the following line to the file, save and exit
    /- /etc/auto.direct
    

    如果使用 NFSv3,請使用下列專案建立新的檔案:

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=3,nobind 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=3,nobind 10.1.0.4:/trans
    /usr/sap/QAS/D03 -nfsvers=3,nobind 10.1.0.4:/usrsapqas/usrsapQASaas
    

    如果使用 NFSv4.1,請使用下列專案建立新的檔案:

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/QAS -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/sapmntQAS
    /usr/sap/trans -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/trans
    /usr/sap/QAS/D03 -nfsvers=4.1,nobind,sec=sys 10.1.0.4:/usrsapqas/usrsapQASaas
    

    重新啟動 autofs 以掛接新的共用

    sudo systemctl enable autofs
    sudo service autofs restart
    
  8. [A] 設定 SWAP 檔案

    sudo vi /etc/waagent.conf
    
    # Set the property ResourceDisk.EnableSwap to y
    # Create and use swapfile on resource disk.
    ResourceDisk.EnableSwap=y
    
    # Set the size of the SWAP file with property ResourceDisk.SwapSizeMB
    # The free space of resource disk varies by virtual machine size. Make sure that you do not set a value that is too big. You can check the SWAP space with command swapon
    # Size of the swapfile.
    ResourceDisk.SwapSizeMB=2000
    

    重新啟動代理程式以啟用變更

    sudo service waagent restart
    

安裝資料庫

在此範例中,SAP NetWeaver 會安裝在 SAP HANA 上。 您可以使用每個支援的資料庫來進行此安裝。 如需如何在 Azure 中安裝 SAP HANA 的詳細資訊,請參閱 Sap HANA on Azure 虛擬機器 (VM) 的高可用性。 如需支援的資料庫清單,請參閱 SAP 附注1928533

  • 執行 SAP 資料庫實例安裝

    使用對應至資料庫負載平衡器前端組態 IP 位址的虛擬主機名,將 SAP NetWeaver 資料庫實例安裝為根目錄。

    您可以使用 sapinst 參數SAPINST_REMOTE_ACCESS_USER來允許非根用戶連線到 sapinst。

    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin
    

SAP NetWeaver 應用程式伺服器安裝

請遵循下列步驟來安裝 SAP 應用程式伺服器。

  1. [A] 準備應用程式伺服器遵循上述 SAP NetWeaver 應用程式伺服器準備一章中的步驟來準備應用程式伺服器。

  2. [A] 安裝 SAP NetWeaver 應用程式伺服器 安裝主要或其他 SAP NetWeaver 應用程式伺服器。

    您可以使用 sapinst 參數SAPINST_REMOTE_ACCESS_USER來允許非根用戶連線到 sapinst。

    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin
    
  3. [A] 更新 SAP HANA 安全存放區

    更新 SAP HANA 安全存放區,以指向 SAP HANA 系統復寫設定的虛擬名稱。

    執行下列命令以列出專案

    hdbuserstore List
    

    這應該會列出所有專案,而且看起來應該類似

    DATA FILE       : /home/qasadm/.hdb/anftstsapa01/SSFS_HDB.DAT
    KEY FILE        : /home/qasadm/.hdb/anftstsapa01/SSFS_HDB.KEY
    
    KEY DEFAULT
      ENV : 10.1.1.5:30313
      USER: SAPABAP1
      DATABASE: QAS
    

    輸出顯示預設進入的IP位址指向虛擬機,而不是負載平衡器的IP位址。 必須變更此專案,才能指向負載平衡器的虛擬主機名。 請務必使用相同的埠 (上述輸出中的 30313 ) 和資料庫名稱 (上述輸出中的 QAS )!

    su - qasadm
    
    hdbuserstore SET DEFAULT qasdb:30313@QAS SAPABAP1 <password of ABAP schema>
    

測試叢集設定

徹底測試 Pacemaker 叢集。 執行一般故障轉移測試

下一步