使用 SUSE Linux Enterprise Server 上的 Azure NetApp Files,在 Azure VM 上部署具有待命節點的 SAP HANA 向外延展系統

本文說明如何使用 Azure NetApp Files 作為共用儲存體磁片區的 Azure NetApp Files ,在具有待命的向 外延展設定中部署高可用性 SAP HANA 系統。

在範例組態、安裝命令等中,HANA 實例為 03,HANA 系統識別碼為 HN1 。 這些範例以 HANA 2.0 SP4 和 SUSE Linux Enterprise Server for SAP 12 SP4 為基礎。

開始之前,請參閱下列 SAP 附注和檔:

概觀

達成 HANA 高可用性的其中一種方法是設定主機自動容錯移轉。 若要設定主機自動容錯移轉,您可以將一或多個虛擬機器新增至 HANA 系統,並將其設定為待命節點。 當作用中節點失敗時,待命節點會自動接管。 在呈現的 Azure 虛擬機器設定中,您可以使用 Azure NetApp Files 上的 NFS 來達成自動容錯移轉

注意

待命節點需要存取所有資料庫磁片區。 HANA 磁片區必須掛接為 NFSv4 磁片區。 NFSv4 通訊協定中改善的檔案租用型鎖定機制用於 I/O 隔離。

重要

若要建置支援的組態,您必須將 HANA 資料和記錄磁片區部署為 NFSv4.1 磁片區,並使用 NFSv4.1 通訊協定加以掛接。 NFSv3 不支援具有待命節點的 HANA 主機自動容錯移轉設定。

SAP NetWeaver High Availability overview

在上圖中,遵循 SAP HANA 網路建議,三個子網會在一個 Azure 虛擬網路內表示:

  • 針對用戶端通訊
  • 用於與儲存體系統的通訊
  • 用於內部 HANA 節點間通訊

Azure NetApp 磁片區位於不同的子網中, 委派給 Azure NetApp Files

在此範例組態中,子網為:

  • client 10.23.0.0/24
  • storage 10.23.2.0/24
  • hana 10.23.3.0/24
  • anf 10.23.1.0/26

設定 Azure NetApp Files 基礎結構

在繼續設定 Azure NetApp Files 基礎結構之前,請先熟悉 Azure NetApp Files 檔

Azure NetApp Files 可在數個 Azure 區域中 使用。 檢查您選取的 Azure 區域是否提供 Azure NetApp Files。

如需依 Azure 區域提供 Azure NetApp Files 可用性的詳細資訊,請參閱 Azure 區域的 Azure NetApp Files 可用性。

重要考量

當您在 SUSE 高可用性架構上建立適用于 SAP NetWeaver 的 Azure NetApp Files 時,請注意適用于 SAP HANA 的 NFS v4.1 磁片區中 記載的重要考慮。

Azure NetApp Files 上的 HANA 資料庫大小調整

Azure NetApp Files 磁片區的輸送量是磁片區大小和服務等級的函式,如 Azure NetApp Files 的服務等級中所述

當您使用 Azure NetApp Files 在 Azure 上設計 SAP HANA 的基礎結構時,請注意適用于 SAP HANA 的 Azure NetApp Files 上的 NFS v4.1 磁片區中的 建議。

本文中的設定會顯示簡單的 Azure NetApp Files 磁片區。

重要

對於效能是關鍵的生產系統,建議您評估及考慮使用 適用于 SAP HANA 的 Azure NetApp Files 應用程式磁片區群組。

部署 Azure NetApp Files 資源

下列指示假設您已部署 Azure 虛擬網路 。 將掛接 Azure NetApp Files 資源的 Azure NetApp Files 資源和 VM,必須部署在相同的 Azure 虛擬網路或對等互連 Azure 虛擬網路中。

  1. 依照建立 NetApp 帳戶中的 指示,在選取的 Azure 區域中建立 NetApp 帳戶

  2. 遵循設定 Azure NetApp Files 容量集區中的 指示,設定 Azure NetApp Files 容量集區

    本文中顯示的 HANA 架構會使用 Ultra 服務 層級的單一 Azure NetApp Files 容量集區 。 針對 Azure 上的 HANA 工作負載,我們建議使用 Azure NetApp Files Ultra 進階版 service Level

  3. 將子網委派給 Azure NetApp Files,如將子網委派給 Azure NetApp Files 中的 指示所述。

  4. 遵循為 Azure NetApp Files 建立 NFS 磁片區中的 指示,部署 Azure NetApp Files 磁片區。

    當您部署磁片區時,請務必選取 NFSv4.1 版本。 目前,需要將 NFSv4.1 的存取新增至允許清單。 在指定的 Azure NetApp Files 子網中部署磁片 區。 Azure NetApp 磁片區的 IP 位址會自動指派。

    請記住,Azure NetApp Files 資源和 Azure VM 必須位於相同的 Azure 虛擬網路或對等互連的 Azure 虛擬網路中。 例如, HN1-data-mnt00001、HN1-log-mnt00001 等等,是磁片區名稱和 nfs://10.23.1.5/ HN1-data-mnt00001、 nfs://10.23.1.4/ HN1-log-mnt00001 等等,都是 Azure NetApp Files 磁片區的檔案路徑。

    • volume HN1-data-mnt00001 (nfs://10.23.1.5/ HN1-data-mnt00001
    • volume HN1-data-mnt00002 (nfs://10.23.1.6/ HN1-data-mnt00002
    • volume HN1-log-mnt00001 (nfs://10.23.1.4/ HN1-log-mnt00001
    • volume HN1-log-mnt00002 (nfs://10.23.1.6/ HN1-log-mnt00002
    • 磁片區 HN1 共用 (nfs://10.23.1.4/ HN1 共用)

    在此範例中,我們會針對每個 HANA 資料和記錄磁片區使用不同的 Azure NetApp Files 磁片區。 針對較小或非生產力系統上的成本優化設定,可以將所有資料掛接和所有記錄掛接放在單一磁片區上。

透過 Azure 入口網站 部署 Linux 虛擬機器

首先,您需要建立 Azure NetApp Files 磁片區。 然後執行下列步驟:

  1. Azure 虛擬網路中 建立 Azure 虛擬網路 子網 。

  2. 部署 VM。

  3. 建立其他網路介面,並將網路介面連結至對應的 VM。

    每個虛擬機器都有三個網路介面,其對應至三個 Azure 虛擬網路子網( clientstoragehana )。

    如需詳細資訊,請參閱 在 Azure 中使用多個網路介面卡 建立 Linux 虛擬機器。

重要

對於 SAP HANA 工作負載,低延遲非常重要。 若要達到低延遲,請與您的 Microsoft 代表合作,確保虛擬機器和 Azure NetApp Files 磁片區部署在鄰近位置。 當您使用 SAP HANA Azure NetApp Files 上線新的 SAP HANA 系統 時,請提交必要的資訊。

下一個指示假設您已建立資源群組、Azure 虛擬網路和三個 Azure 虛擬網路子網: clientstoragehana 。 當您部署 VM 時,請選取用戶端子網,讓用戶端網路介面是 VM 上的主要介面。 您也必須透過儲存體子網閘道設定 Azure NetApp Files 委派子網的明確路由。

重要

請確定您選取的 OS 是針對您所使用之特定 VM 類型上的 SAP HANA 認證。 如需這些類型的 SAP HANA 認證 VM 類型和 OS 版本清單,請移至 SAP HANA 認證的 IaaS 平臺 網站。 按一下列出的 VM 類型詳細資料,以取得該類型 SAP HANA 支援的 OS 版本完整清單。

  1. 建立 SAP HANA 的可用性設定組。 請務必設定最大更新網域。

  2. 執行下列步驟來建立三部虛擬機器( hanadb1 hanadb2 hanadb3 ) :

    a. 在 SAP HANA 支援的 Azure 資源庫中,使用SLES4SAP映射。

    b. 選取您稍早為 SAP HANA 建立的可用性設定組。

    c. 選取用戶端 Azure 虛擬網路子網。 選取 [ 加速網路 ]。

    當您部署虛擬機器時,會自動產生網路介面名稱。 為了簡單起見,我們將參考自動產生的網路介面,這些網路介面會附加至用戶端 Azure 虛擬網路子網,例如 hanadb1-client、hanadb2-client hanadb3-client

  3. 針對虛擬網路子網,為每個虛擬機器 storage 建立三個網路介面(在此範例中為 hanadb1-storage、 hanadb2-storage hanadb3-storage )。

  4. 針對虛擬網路子網建立三個網路介面, hana 每個虛擬機器各一個(在此範例中為 hanadb1-hana、 hanadb2-hana hanadb3-hana )。

  5. 執行下列步驟,將新建立的虛擬網路介面附加至對應的虛擬機器:

    1. 移至Azure 入口網站 中的 虛擬機器。
    2. 在左窗格中,選取 [虛擬機器 ]。 篩選虛擬機器名稱(例如 hanadb1 ),然後選取虛擬機器。
    3. 在 [概 觀] 窗格中,選取 [ 停止 ] 以解除配置虛擬機器。
    4. 選取 [ 網路] ,然後連結網路介面。 在 [ 連結網路介面] 下拉式清單中,選取已建立的 storagehana 子網網路介面。
    5. 選取 [儲存]。
    6. 針對其餘虛擬機器重複步驟 b 到 e (在我們的範例中為 hanadb2 hanadb3 )。
    7. 暫時讓虛擬機器處於停止狀態。 接下來,我們將為所有新連結的網路介面啟用 加速網路
  6. 執行下列步驟,為 storagehana 子網的其他網路介面啟用加速網路功能:

    1. 在Azure 入口網站中開啟 Azure Cloud Shell

    2. 執行下列命令,為附加至 storagehana 子網的其他網路介面啟用加速網路。

      az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb1-storage --accelerated-networking true
       az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb2-storage --accelerated-networking true
       az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb3-storage --accelerated-networking true
      
       az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb1-hana --accelerated-networking true
       az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb2-hana --accelerated-networking true
       az network nic update --id /subscriptions/your subscription/resourceGroups/your resource group/providers/Microsoft.Network/networkInterfaces/hanadb3-hana --accelerated-networking true
      
  7. 執行下列步驟來啟動虛擬機器:

    1. 在左窗格中,選取 [虛擬機器 ]。 篩選虛擬機器名稱(例如 hanadb1 ),然後選取它。
    2. 在 [概 觀] 窗格中,選取 [ 開始 ]。

作業系統設定和準備

後續各節中的指示前面會加上下列其中一項:

  • [A] : 適用于所有節點
  • [1] : 僅適用于節點 1
  • [2] : 僅適用于節點 2
  • [3] : 僅適用于節點 3

執行下列步驟來設定和準備您的 OS:

  1. [A] 維護虛擬機器上的主機檔案。 包含所有子網的專案。 此範例已將下列專案新增至 /etc/hosts

    # Storage
     10.23.2.4   hanadb1-storage
     10.23.2.5   hanadb2-storage
     10.23.2.6   hanadb3-storage
     # Client
     10.23.0.5   hanadb1
     10.23.0.6   hanadb2
     10.23.0.7   hanadb3
     # Hana
     10.23.3.4   hanadb1-hana
     10.23.3.5   hanadb2-hana
     10.23.3.6   hanadb3-hana
    
  2. [A] 變更儲存體網路介面的 DHCP 和雲端組態設定,以避免發生非預期的主機名稱變更。

    下列指示假設儲存體網路介面為 eth1

    vi /etc/sysconfig/network/dhcp 
    # Change the following DHCP setting to "no"
    DHCLIENT_SET_HOSTNAME="no"
    
    vi /etc/sysconfig/network/ifcfg-eth1
    # Edit ifcfg-eth1 
    #Change CLOUD_NETCONFIG_MANAGE='yes' to "no"
    CLOUD_NETCONFIG_MANAGE='no'
    
  3. [A] 新增網路路由,讓 Azure NetApp Files 的通訊會透過儲存體網路介面進行。

    下列指示假設儲存體網路介面為 eth1

    vi /etc/sysconfig/network/ifroute-eth1
    
    # Add the following routes 
    # RouterIPforStorageNetwork - - -
    # ANFNetwork/cidr RouterIPforStorageNetwork - -
    10.23.2.1 - - -
    10.23.1.0/26 10.23.2.1 - -
    

    重新開機 VM 以啟用變更。

  4. [A] 準備作業系統以在 NetApp Systems 上使用 NFS 執行 SAP HANA,如 SAP 附注 3024346 - NetApp NFS 的 Linux 核心設定中所述。 建立 NetApp 組態設定的組態檔 /etc/sysctl.d/91-NetApp-HANA.conf

    vi /etc/sysctl.d/91-NetApp-HANA.conf
    
    # Add the following entries in the configuration file
    net.core.rmem_max = 16777216
    net.core.wmem_max = 16777216
    net.ipv4.tcp_rmem = 4096 131072 16777216
    net.ipv4.tcp_wmem = 4096 16384 16777216
    net.core.netdev_max_backlog = 300000
    net.ipv4.tcp_slow_start_after_idle=0
    net.ipv4.tcp_no_metrics_save = 1
    net.ipv4.tcp_moderate_rcvbuf = 1
    net.ipv4.tcp_window_scaling = 1
    net.ipv4.tcp_timestamps = 1
    net.ipv4.tcp_sack = 1
    
  5. [A] 使用 Microsoft 建立組態檔 /etc/sysctl.d/ms-az.conf for Azure 組態設定。

    vi /etc/sysctl.d/ms-az.conf
    
    # Add the following entries in the configuration file
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv4.tcp_max_syn_backlog = 16348
    net.ipv4.conf.all.rp_filter = 0
    sunrpc.tcp_slot_table_entries = 128
    vm.swappiness=10
    

    [!提示] 避免在 sysctl 組態檔中明確設定net.ipv4.ip_local_port_range和net.ipv4.ip_local_reserved_ports,以允許 SAP 主機代理程式管理埠範圍。 如需詳細資訊,請參閱 SAP 附注 2382421

  6. [A] 調整 NFSv3 磁片區的 sunrpc 設定,如 SAP 注意事項 3024346 - NetApp NFS 的 Linux 核心設定所建議。

    vi /etc/modprobe.d/sunrpc.conf
    
    # Insert the following line
    options sunrpc tcp_max_slot_table_entries=128
    

掛接 Azure NetApp Files 磁片區

  1. [A] 建立 HANA 資料庫磁片區的掛接點。

    mkdir -p /hana/data/HN1/mnt00001
    mkdir -p /hana/data/HN1/mnt00002
    mkdir -p /hana/log/HN1/mnt00001
    mkdir -p /hana/log/HN1/mnt00002
    mkdir -p /hana/shared
    mkdir -p /usr/sap/HN1
    
  2. [1] 在 HN1 共用上 建立 /usr/sap 的節點特定目錄。

    # Create a temporary directory to mount HN1-shared
    mkdir /mnt/tmp
    
    # if using NFSv3 for this volume, mount with the following command
    mount 10.23.1.4:/HN1-shared /mnt/tmp
    
    # if using NFSv4.1 for this volume, mount with the following command
    mount -t nfs -o sec=sys,nfsvers=4.1 10.23.1.4:/HN1-shared /mnt/tmp
    
    cd /mnt/tmp
    mkdir shared usr-sap-hanadb1 usr-sap-hanadb2 usr-sap-hanadb3
    
    # unmount /hana/shared
    cd
    umount /mnt/tmp
    
  3. [A] 確認 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
    
  4. [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.23.1.4:/HN1-shared /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
    
  5. [A] 手動建立 SAP HANA 群組和使用者。 群組 sapsys 和使用者 hn1 adm 的識別碼必須設定為在上架期間提供的相同識別碼。 (在此範例中,識別碼設定為 1001 。如果未正確設定識別碼,您將無法存取磁片區。 群組 sapsys 和使用者帳戶 hn1 adm 和 sapadm 的識別碼在所有虛擬機器上都必須相同。

    # Create user group 
    sudo groupadd -g 1001 sapsys
    
    # Create  users 
    sudo useradd hn1adm -u 1001 -g 1001 -d /usr/sap/HN1/home -c "SAP HANA Database System" -s /bin/sh
    sudo useradd sapadm -u 1002 -g 1001 -d /home/sapadm -c "SAP Local Administrator" -s /bin/sh
    
    # Set the password  for both user ids
    sudo passwd hn1adm
    sudo passwd sapadm
    
  6. [A] 掛接共用的 Azure NetApp Files 磁片區。

    sudo vi /etc/fstab
    
    # Add the following entries
    10.23.1.5:/HN1-data-mnt00001 /hana/data/HN1/mnt00001  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    10.23.1.6:/HN1-data-mnt00002 /hana/data/HN1/mnt00002  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    10.23.1.4:/HN1-log-mnt00001 /hana/log/HN1/mnt00001  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    10.23.1.6:/HN1-log-mnt00002 /hana/log/HN1/mnt00002  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    10.23.1.4:/HN1-shared/shared /hana/shared  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    
    # Mount all volumes
    sudo mount -a
    

    對於需要較高輸送量的工作負載,請考慮使用 nconnect 掛接選項,如 Azure NetApp Files for SAP HANA 上的 NFS v4.1 磁片區中所述 。 檢查 Linux 版本上的 Azure NetApp Files 是否 nconnect 支援。

  7. [1] 在 hanadb1 掛接節點特定磁片區。

    sudo vi /etc/fstab
    
    # Add the following entries
    10.23.1.4:/HN1-shared/usr-sap-hanadb1 /usr/sap/HN1  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    
    # Mount the volume
    sudo mount -a
    
  8. [2] 在 hanadb2 掛接節點特定磁片區。

    sudo vi /etc/fstab
    
    # Add the following entries
    10.23.1.4:/HN1-shared/usr-sap-hanadb2 /usr/sap/HN1  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    
    # Mount the volume
    sudo mount -a
    
  9. [3] 在 hanadb3 掛接節點特定磁片區。

    sudo vi /etc/fstab
    
    # Add the following entries
    10.23.1.4:/HN1-shared/usr-sap-hanadb3 /usr/sap/HN1  nfs   rw,nfsvers=4.1,hard,timeo=600,rsize=262144,wsize=262144,noatime,lock,_netdev,sec=sys  0  0
    
    # Mount the volume
    sudo mount -a
    
  10. [A] 確認所有 HANA 磁片區都已掛接 NFS 通訊協定 NFSv4.1

    sudo nfsstat -m
    
    # Verify that flag vers is set to 4.1 
    # Example from hanadb1
    /hana/data/HN1/mnt00001 from 10.23.1.5:/HN1-data-mnt00001
     Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.5
    /hana/log/HN1/mnt00002 from 10.23.1.6:/HN1-log-mnt00002
     Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.6
    /hana/data/HN1/mnt00002 from 10.23.1.6:/HN1-data-mnt00002
     Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.6
    /hana/log/HN1/mnt00001 from 10.23.1.4:/HN1-log-mnt00001
    Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.4
    /usr/sap/HN1 from 10.23.1.4:/HN1-shared/usr-sap-hanadb1
     Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.4
    /hana/shared from 10.23.1.4:/HN1-shared/shared
     Flags: rw,noatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.23.2.4,local_lock=none,addr=10.23.1.4
    

安裝

在此範例中,我們將使用 HANA 2.0 SP4,在向外延展組態中部署具有待命節點的 SAP HANA。

準備 HANA 安裝

  1. [A] 在 HANA 安裝之前,設定根密碼。 您可以在安裝完成後停用根密碼。 以命令 passwd 身分 root 執行 。

  2. [1] 確認您可以透過 SSH 登入 hanadb2 hanadb3 ,而不提示輸入密碼。

    ssh root@hanadb2
    ssh root@hanadb3
    
  3. [A] 安裝 HANA 2.0 SP4 所需的其他套件。 如需詳細資訊,請參閱 SAP 附注 2593824

    sudo zypper install libgcc_s1 libstdc++6 libatomic1
    
  4. [2], [3] 將 SAP HANA datalog 目錄的擁有權變更為 hn1 adm。

    # Execute as root
    sudo chown hn1adm:sapsys /hana/data/HN1
    sudo chown hn1adm:sapsys /hana/log/HN1
    

HANA 安裝

  1. [1] 遵循 SAP HANA 2.0 安裝和更新指南 中的 指示安裝 SAP HANA。 在此範例中,我們會使用主要、一個背景工作角色和一個待命節點來安裝 SAP HANA 向外延展。

    1. 從 HANA 安裝軟體目錄啟動 hdblcm 程式。 internal_network使用 參數並傳遞子網的位址空間,用於內部 HANA 節點間通訊。

      ./hdblcm --internal_network=10.23.3.0/24
      
    2. 在提示字元中,輸入下列值:

      • 針對 [ 選擇動作 ]:輸入 1 (適用于安裝)
      • 如需 安裝 的其他元件:輸入 2,3
      • 針對安裝路徑:按 Enter 鍵(預設為 /hana/shared)
      • 針對 [ 本機主機名稱 ]:按 Enter 以接受預設值
      • 在 [ 您要將主機新增至系統嗎? ]:輸入 y
      • 若要 新增 逗號分隔主機名稱:輸入 hanadb2、hanadb3
      • 針對 根使用者名稱 [root]:按 Enter 以接受預設值
      • 針對 [根使用者密碼 :輸入根使用者的密碼]
      • 針對主機 hanadb2 的角色:輸入 1 (針對背景工作角色)
      • 針對 主機 hanadb2 的主機容錯移轉群組 [預設值]:按 Enter 以接受預設值
      • 針對 主機 hanadb2 的儲存體分割編號 [ << 自動 >> 指派]:按 Enter 以接受預設值
      • 針對 主機 hanadb2 的背景工作群組 [預設值]:按 Enter 以接受預設值
      • 針對 [選取 主機 hanadb3 的角色 ]:輸入 2 (針對待命)
      • 針對 主機 hanadb3 的主機容錯移轉群組 [預設值]:按 Enter 以接受預設值
      • 針對 主機 hanadb3 的背景工作群組 [預設值]:按 Enter 以接受預設值
      • 針對 SAP HANA 系統識別碼 :輸入 HN1
      • 針對 實例編號 [00]:輸入 03
      • 針對 [預設] 的 [本機主機背景工作角色群組 ]:按 Enter 以接受預設值
      • 針對 [選取系統使用量] / 輸入索引 [4] :輸入 4 (針對自訂)
      • 針對 資料磁片區 的位置 [/hana/data/HN1]:按 Enter 以接受預設值
      • 針對 記錄磁片區 的位置 [/hana/log/HN1]:按 Enter 以接受預設值
      • 針對 [限制記憶體配置上限嗎? [n]: 輸入 n
      • 針對 主機 hanadb1 的憑證主機名稱 [hanadb1 ]:按 Enter 以接受預設值
      • 針對 主機 hanadb2 [hanadb2 ]:按 Enter 以接受預設值
      • 針對 [主機 hanadb3] 的憑證主機名稱 [hanadb3 ]:按 Enter 以接受預設值
      • 針對 系統管理員istrator (hn1adm) 密碼 :輸入密碼
      • 針對 [系統資料庫使用者] [系統] 密碼 :輸入系統的密碼
      • 針對 [確認系統資料庫使用者][系統] [密碼 ]:輸入系統的密碼
      • 針對機器 重新開機後重新開機系統嗎? [n]: 輸入 n
      • 針對 [您要繼續] [y/n] :驗證摘要,如果一切看起來都不錯,請輸入 y
  2. [1] 驗證 global.ini。

    顯示 global.ini,並確定已備妥內部 SAP HANA 節點間通訊的設定。 確認通訊 區段。 它應該有子網的 hana 位址空間,而且 listeninterface 應該設定為 .internal確認 [internal_hostname_resolution ] 區段。 它應該具有屬於 hana 子網之 HANA 虛擬機器的 IP 位址。

    sudo cat /usr/sap/HN1/SYS/global/hdb/custom/config/global.ini
    
    # Example 
    #global.ini last modified 2019-09-10 00:12:45.192808 by hdbnameserve
    [communication]
    internal_network = 10.23.3/24
    listeninterface = .internal
    [internal_hostname_resolution]
    10.23.3.4 = hanadb1
    10.23.3.5 = hanadb2
    10.23.3.6 = hanadb3
    
  3. [1] 新增主機對應,以確保用戶端 IP 位址用於用戶端通訊。 新增 區段 public_host_resolution ,然後從用戶端子網新增對應的 IP 位址。

    sudo vi /usr/sap/HN1/SYS/global/hdb/custom/config/global.ini
    
    #Add the section
    [public_hostname_resolution]
    map_hanadb1 = 10.23.0.5
    map_hanadb2 = 10.23.0.6
    map_hanadb3 = 10.23.0.7
    
  4. [1] 重新開機 SAP HANA 以啟用變更。

    sudo -u hn1adm /usr/sap/hostctrl/exe/sapcontrol -nr 03 -function StopSystem HDB
    sudo -u hn1adm /usr/sap/hostctrl/exe/sapcontrol -nr 03 -function StartSystem HDB
    
  5. [1] 確認用戶端介面將使用來自子網的 client IP 位址進行通訊。

    sudo -u hn1adm /usr/sap/HN1/HDB03/exe/hdbsql -u SYSTEM -p "password" -i 03 -d SYSTEMDB 'select * from SYS.M_HOST_INFORMATION'|grep net_publicname
    
    # Expected result
    "hanadb3","net_publicname","10.23.0.7"
    "hanadb2","net_publicname","10.23.0.6"
    "hanadb1","net_publicname","10.23.0.5"
    

    如需如何驗證設定的資訊,請參閱 SAP 附注 2183363 - SAP HANA 內部網路的 設定。

  6. 若要針對基礎 Azure NetApp Files 儲存體優化 SAP HANA,請設定下列 SAP HANA 參數:

    • max_parallel_io_requests128
    • async_read_submiton
    • async_write_submit_activeon
    • async_write_submit_blocks全部

    如需詳細資訊,請參閱 SAP HANA 的 I/O 堆疊組態。

    從 SAP HANA 2.0 系統開始,您可以在 中 global.ini 設定參數。 如需詳細資訊,請參閱 SAP 附注 1999930

    針對 SAP HANA 1.0 系統版本 SPS12 和更早版本,您可以在安裝期間設定這些參數,如 SAP 附注 2267798 中所述。

  7. Azure NetApp Files 所使用的儲存體檔案大小限制為 16 TB(TB)。 SAP HANA 不會隱含地感知儲存體限制,而且當達到 16 TB 的檔案大小限制時,它不會自動建立新的資料檔案。 當 SAP HANA 嘗試將檔案成長超過 16 TB 時,該嘗試會導致錯誤,最後在索引伺服器當機時。

    重要

    若要防止 SAP HANA 嘗試將資料檔案成長超過 儲存體子系統的 16 TB 限制 ,請在 中 global.ini 設定下列參數。

    • datavolume_striping = true
    • datavolume_striping_size_gb = 15000 如需詳細資訊,請參閱 SAP 附注 2400005 。 請注意 SAP 附注 2631285

測試 SAP HANA 容錯移轉

注意

本文包含 Microsoft 不再使用的詞彙參考。 從軟體中移除這些字詞時,我們會從本文中移除這些字詞。

  1. 模擬 SAP HANA 背景工作節點上的節點當機。 執行下列操作:

    1. 在模擬節點當機之前,請以 hn1 adm 身 分執行下列命令來擷取環境的狀態:

      # Check the landscape status
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker  | worker  | default | default |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | yes    | ignore |          |        |         0 |         0 | default  | default  | master 3   | slave      | standby     | standby     | standby | standby | default | -       |
      
      # Check the instance status
      sapcontrol -nr 03  -function GetSystemInstanceList
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GREEN
      
    2. 若要模擬節點當機,請在背景工作節點上以 root 身分執行下列命令,在此案例中為 hanadb2

      echo b > /proc/sysrq-trigger
      
    3. 監視系統以進行容錯移轉完成。 當容錯移轉完成時,擷取狀態,如下所示:

      # Check the instance status
      sapcontrol -nr 03  -function GetSystemInstanceList
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GREEN
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GRAY
      
      # Check the landscape status
      /usr/sap/HN1/HDB03/exe/python_support> python landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker  | worker  | default | default |
      | hanadb2 | no     | info   |          |        |         2 |         0 | default  | default  | master 2   | slave      | worker      | standby     | worker  | standby | default | -       |
      | hanadb3 | yes    | info   |          |        |         0 |         2 | default  | default  | master 3   | slave      | standby     | slave       | standby | worker  | default | default |
      

      重要

      當節點遇到核心異常時,請在所有 HANA 虛擬機器上設定 kernel.panic 為 20 秒,以避免 SAP HANA 容錯移轉延遲 。 組態是在 中 /etc/sysctl 完成。 重新開機虛擬機器以啟用變更。 如果未執行這項變更,當節點發生核心異常時,容錯移轉可能需要 10 分鐘以上的時間。

  2. 執行下列動作來終止名稱伺服器:

    1. 測試之前,請執行下列命令作為 hn1 adm 來檢查環境的狀態:

      #Landscape status 
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker  | worker  | default | default |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | no     | ignore |          |        |         0 |         0 | default  | default  | master 3   | slave      | standby     | standby     | standby | standby | default | -       |
      
      # Check the instance status
      sapcontrol -nr 03  -function GetSystemInstanceList
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GRAY
      
    2. 在作用中主要節點上以 hn1 adm 身分 執行下列命令,在此案例中為 hanadb1

      hn1adm@hanadb1:/usr/sap/HN1/HDB03> HDB kill
      

      待命節點 hanadb3 將接管為主要節點。 以下是容錯移轉測試完成後的資源狀態:

      # Check the instance status
      sapcontrol -nr 03 -function GetSystemInstanceList
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GRAY
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GREEN
      
      # Check the landscape status
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | no     | info   |          |        |         1 |         0 | default  | default  | master 1   | slave      | worker      | standby     | worker  | standby | default | -       |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | yes    | info   |          |        |         0 |         1 | default  | default  | master 3   | master     | standby     | master      | standby | worker  | default | default |
      
    3. 在 hanadb1 重新開機 HANA 實例(也就是在同一部虛擬機器上終止名稱伺服器)。 hanadb1 節點會重新加入環境,並保留其待命角色。

      hn1adm@hanadb1:/usr/sap/HN1/HDB03> HDB start
      

      SAP HANA 在 hanadb1 上啟動 之後,預期會有下列狀態:

      # Check the instance status
      sapcontrol -nr 03 -function GetSystemInstanceList
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GREEN
      # Check the landscape status
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | info   |          |        |         1 |         0 | default  | default  | master 1   | slave      | worker      | standby     | worker  | standby | default | -       |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | yes    | info   |          |        |         0 |         1 | default  | default  | master 3   | master     | standby     | master      | standby | worker  | default | default |
      
    4. 同樣地,終止目前作用中主要節點上的名稱伺服器(也就是在節點 hanadb3 上)。

      hn1adm@hanadb3:/usr/sap/HN1/HDB03> HDB kill
      

      Node hanadb1 將會繼續主要節點的角色。 容錯移轉測試完成後,狀態看起來會像這樣:

      # Check the instance status
      sapcontrol -nr 03  -function GetSystemInstanceList & python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GRAY
      
      # Check the landscape status
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker  | worker  | default | default |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | no     | ignore |          |        |         0 |         0 | default  | default  | master 3   | slave      | standby     | standby     | standby | standby | default | -       |
      
    5. 在 hanadb3 啟動 SAP HANA,這會準備好作為待命節點。

      hn1adm@hanadb3:/usr/sap/HN1/HDB03> HDB start
      

      SAP HANA 在 hanadb3 啟動之後,狀態看起來如下所示:

      # Check the instance status
      sapcontrol -nr 03  -function GetSystemInstanceList & python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      GetSystemInstanceList
      OK
      hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
      hanadb1, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb2, 3, 50313, 50314, 0.3, HDB|HDB_WORKER, GREEN
      hanadb3, 3, 50313, 50314, 0.3, HDB|HDB_STANDBY, GRAY
      # Check the landscape status
      python /usr/sap/HN1/HDB03/exe/python_support/landscapeHostConfiguration.py
      | Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host    | Host    | Worker  | Worker  |
      |         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config  | Actual  | Config  | Actual  |
      |         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles   | Roles   | Groups  | Groups  |
      | ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------- | ------- | ------- |
      | hanadb1 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker  | worker  | default | default |
      | hanadb2 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker  | worker  | default | default |
      | hanadb3 | no     | ignore |          |        |         0 |         0 | default  | default  | master 3   | slave      | standby     | standby     | standby | standby | default | -       |
      

下一步