다음을 통해 공유


RHEL에서 SAP ASCS/SCS 고가용성 VM을 사용하여 SAP 대화 상자 인스턴스 배포

이 문서에서는 RHEL(Red Hat Enterprise Linux)에서 실행되는 동일한 ASCS(ABAP SAP Central Services)/SCS(SAP Central Services) 고가용성 클러스터에 PAS(기본 애플리케이션 서버) 및 AAS(추가 애플리케이션 서버) 대화 상자 인스턴스를 설치하고 구성하는 방법을 설명합니다.

참조

개요

이 문서에서는 고가용성 설정에서 SAP ASCS/SCS 및 ERS(Enqueue Replication Server) 인스턴스와 함께 PAS 및 AAS 대화 상자 인스턴스를 배포하는 비용 최적화 시나리오에 대해 설명합니다. 단일 SAP 시스템의 VM 수를 최소화하려면 SAP ASCS/SCS 및 SAP ERS가 실행되는 동일한 호스트에 PAS 및 AAS를 설치하려고 합니다. 고가용성 클러스터 설정에서 SAP ASCS/SCS를 구성하면 PAS 및 AAS도 클러스터에서 관리할 수 있습니다. 구성은 기본적으로 이미 구성된 SAP ASCS/SCS 클러스터 설정에 추가된 것입니다. 이 설정에서는 PAS와 AAS가 가상 호스트 이름에 설치되고 해당 인스턴스 디렉터리는 클러스터에서 관리됩니다.

이 설정을 위해 PAS 및 AAS에는 고가용성 인스턴스 디렉터리(/usr/sap/<SID>/D<nr>)가 필요합니다. ASCS 및 ERS 인스턴스 구성에 사용한 것과 동일한 고가용성 스토리지에 인스턴스 디렉터리 파일 시스템을 배치할 수 있습니다. 제시된 아키텍처는 설정을 위한 고가용성 인스턴스 디렉터리에 대한 Azure Files의 NFS 또는 Azure NetApp Files를 보여 줍니다.

배포를 설명하기 위해 이 문서에 표시된 예는 다음 시스템 정보를 사용합니다.

인스턴스 이름 인스턴스 번호 가상 호스트 이름 가상 IP(프로브 포트)
ASCS(ABAP SAP Central Services) 00 sapascs 10.90.90.10 (62000)
ERS(Enqueue Replication Server) 01 sapers 10.90.90.9 (62001)
PAS(기본 애플리케이션 서버) 02 sappas 10.90.90.30 (62002)
AAS(추가 애플리케이션 서버) 03 sapers 10.90.90.31 (62003)
SAP 시스템 식별자 NW1 --- ---

참고 항목

스케일 아웃하려면 별도의 VM에 더 많은 SAP 애플리케이션 인스턴스를 설치합니다.

SAP ASCS/SCS 클러스터를 사용한 대화 상자 인스턴스 설치 아키텍처를 보여 주는 다이어그램.

비용 최적화 솔루션에 대한 중요한 고려 사항

  • SAP ASCS/SCS 클러스터 설정으로 두 개의 대화 인스턴스(PAS 및 하나의 AAS)만 배포할 수 있습니다.
  • 더 많은 애플리케이션 서버(예: sapa03sapa04)로 SAP 시스템을 스케일 아웃하려는 경우 별도의 VM에 설치할 수 있습니다. PAS 및 AAS가 가상 호스트 이름에 설치되면 별도의 VM에서 실제 또는 가상 호스트 이름을 사용하여 더 많은 애플리케이션 서버를 설치할 수 있습니다. VM에 가상 호스트 이름을 할당하는 방법에 대해 자세히 알아보려면 Azure에서 Linux와 함께 SAP 가상 호스트 이름 사용 블로그를 참조하세요.
  • SAP ASCS/SCS 클러스터 설정을 사용한 PAS 및 AAS 배포에서는 ASCS, ERS, PAS 및 AAS의 인스턴스 번호가 달라야 합니다.
  • 크기 조정 지침에 따라 VM SKU 크기를 적절하게 조정하는 것이 좋습니다. 클러스터의 다른 VM을 사용할 수 없을 때 단일 VM에서 여러 SAP 인스턴스(ASCS, ERS, PAS 및 AAS)가 실행될 수 있는 클러스터 동작을 고려해야 합니다.
  • SAP ASCS/SCS 클러스터 설정으로 실행되는 대화 상자 인스턴스(PAS 및 AAS)는 가상 호스트 이름을 사용하여 설치해야 합니다.
  • 또한 PAS 및 AAS 인스턴스를 배포하려면 SAP ASCS/SCS 클러스터 설정과 동일한 스토리지 솔루션을 사용해야 합니다. 예를 들어, Azure Files의 NFS를 사용하여 SAP ASCS/SCS 클러스터를 구성한 경우 동일한 스토리지 솔루션을 사용하여 PAS 및 AAS를 배포해야 합니다.
  • PAS 및 AAS의 인스턴스 디렉터리 /usr/sap/<SID>/D<nr>는 NFS 파일 시스템에 탑재되어야 하며 클러스터에서 리소스로 관리됩니다.

    참고 항목

    SAP J2EE 시스템의 경우 Azure Files의 NFS에 /usr/sap/<SID>/J<nr>를 배치할 수 없습니다.

  • 별도의 VM에 더 많은 애플리케이션 서버를 설치하려면 NFS 공유 또는 인스턴스 디렉터리 파일 시스템에 대한 로컬 관리 디스크를 사용할 수 있습니다. SAP J2EE 시스템용 애플리케이션 서버를 더 설치하는 경우 Azure Files의 NFS에 대한 /usr/sap/<SID>/J<nr>는 지원되지 않습니다.
  • 기존 SAP ASCS/SCS 고가용성 구성에서 별도의 VM에서 실행되는 애플리케이션 서버 인스턴스는 SAP ASCS 및 ERS 클러스터 노드에 영향이 있을 때 영향을 받지 않습니다. 그러나 비용 최적화 구성을 사용하면 클러스터의 노드 중 하나에 영향이 있을 때 PAS 또는 AAS 인스턴스가 다시 시작됩니다.
  • 이 설정에도 동일한 고려 사항이 적용되므로 Azure Files의 NFS 고려 사항Azure NetApp Files 고려 사항을 참조하세요.

필수 조건

이 문서에서 설명하는 구성은 이미 구성된 SAP ASCS/SCS 클러스터 설정에 추가된 것입니다. 이 구성에서는 PAS와 AAS가 가상 호스트 이름에 설치되고 해당 인스턴스 디렉터리는 클러스터에서 관리됩니다. 스토리지에 따라 다음 문서에 설명된 단계에서 클러스터의 SAP ASCS 및 SAP ERS 인스턴스에 대한 SAPInstance 리소스를 구성합니다.

SWPM(Software Provisioning Manager)을 사용하여 ASCS, ERSDatabase 인스턴스를 설치한 후 다음 단계에 따라 PAS 및 AAS 인스턴스를 설치합니다.

PAS 및 AAS용 Azure Load Balancer 구성

이 문서에서는 Azure Load Balancer 구성에 설명된 대로 SAP ASCS/SCS 클러스터 설정에 대한 Load Balancer를 이미 구성했다고 가정합니다. 동일한 Azure Load Balancer 인스턴스에서 다음 단계에 따라 PAS 및 AAS에 대한 더 많은 프런트 엔드 IP 및 부하 분산 규칙을 ​​만듭니다.

  1. SAP ASCS/SCS 클러스터 설정을 위해 만들어진 내부 부하 분산 장치를 엽니다.
  2. 프런트 엔드 IP 구성: 두 개의 프런트 엔드 IP를 만듭니다. 하나는 PAS용이고 다른 하나는 AAS용입니다(예: 10.90.90.3010.90.90.31).
  3. 백 엔드 풀: PAS와 AAS를 동일한 백 엔드 풀에 배포하므로 이 풀은 동일하게 유지됩니다.
  4. 인바운드 규칙: PAS용과 AAS용으로 하나씩 두 개의 부하 분산 규칙을 만듭니다. 두 부하 분산 규칙 모두에 대해 동일한 단계를 수행합니다.
  5. 프런트 엔드 IP 주소: 프런트 엔드 IP를 선택합니다.
    1. 백 엔드 풀: 백 엔드 풀을 선택합니다.
    2. 고가용성 포트: 이 옵션을 선택합니다.
    3. 프로토콜: TCP를 선택합니다.
    4. 상태 프로브: 다음 세부 정보를 사용하여 상태 프로브를 만듭니다(PAS 및 AAS 모두에 적용).
      1. 프로토콜: TCP를 선택합니다.
      2. 포트: 예: PAS의 경우 620<인스턴스 번호>, AAS의 경우 620<인스턴스 번호>.
      3. 간격: 5를 입력합니다.
      4. 프로브 임계값: 2를 입력합니다.
    5. 유휴 시간 제한(분): 30을 입력합니다.
    6. 부동 IP 사용: 이 옵션을 선택합니다.

Azure Portal에서 비정상 임계값이라고도 알려진 상태 프로브 구성 속성 numberOfProbes는 준수되지 않습니다. 성공하거나 실패한 연속 프로브 수를 제어하려면 probeThreshold 속성을 2로 설정합니다. 현재는 Azure Portal을 사용하여 이 속성을 설정할 수 없습니다. Azure CLI 또는 PowerShell 명령을 사용합니다.

공용 IP 주소가 없는 VM이 내부(공용 IP 주소 없음) 표준 Azure Load Balancer 인스턴스의 백 엔드 풀에 배치되면 공용 엔드포인트로의 라우팅을 허용하도록 추가 구성이 수행되지 않는 한 아웃바운드 인터넷 연결이 이루어지지 않습니다. 아웃바운드 연결을 설정하는 방법에 대한 단계는 SAP 고가용성 시나리오에서 Azure 표준 Load Balancer를 사용하는 Virtual Machines에 대한 퍼블릭 엔드포인트 연결을 참조하세요.

Important

Azure Load Balancer 뒤에 배치되는 Azure VM에서 TCP 타임스탬프를 사용하도록 설정하면 안 됩니다. TCP 타임스탬프를 사용하도록 설정하면 상태 프로브에 오류가 발생합니다. net.ipv4.tcp_timestamps 매개 변수를 0으로 설정합니다. 자세한 내용은 부하 분산 장치 상태 프로브를 참조하세요.

PAS 및 AAS 설치를 위한 서버 준비

이 문서의 단계에 다음 접두사가 표시되면 이는 다음을 의미합니다.

  • [A]: 모든 노드에 적용 가능합니다.
  • [1]: 노드 1에만 적용 가능.
  • [2]: 노드 2에만 적용 가능.
  1. [A] 호스트 이름 확인을 설정합니다.

    DNS 서버를 사용하거나 모든 노드에서 /etc/hosts를 수정할 수 있습니다. 다음 예제에서는 /etc/hosts 파일을 사용하는 방법을 보여 줍니다. 다음 명령에서 IP 주소와 호스트 이름을 바꿉니다.

    sudo vi /etc/hosts
    
    # IP address of cluster node 1
    10.90.90.7    sap-cl1
    # IP address of cluster node 2
    10.90.90.8     sap-cl2
    # IP address of the load balancer frontend configuration for SAP Netweaver ASCS
    10.90.90.10   sapascs
    # IP address of the load balancer frontend configuration for SAP Netweaver ERS
    10.90.90.9    sapers
    # IP address of the load balancer frontend configuration for SAP Netweaver PAS
    10.90.90.30   sappas
    # IP address of the load balancer frontend configuration for SAP Netweaver AAS
    10.90.90.31   sapaas
    
  2. [1] NFS 공유에 SAP 디렉터리를 만듭니다. VM 중 하나의 NFS 공유인 sapnw1을 임시로 탑재하고 중첩된 탑재 지점으로 사용할 SAP 디렉터리를 만듭니다.

    1. Azure Files의 NFS를 사용하는 경우:

      # mount temporarily the volume
      sudo mkdir -p /saptmp
      sudo mount -t nfs sapnfs.file.core.windows.net:/sapnfsafs/sapnw1 /saptmp -o noresvport,vers=4,minorversion=1,sec=sys
      
      # create the SAP directories
      sudo cd /saptmp
      sudo mkdir -p usrsapNW1D02
      sudo mkdir -p usrsapNW1D03
      
      # unmount the volume and delete the temporary directory
      cd ..
      sudo umount /saptmp
      sudo rmdir /saptmp
      
    2. Azure NetApp Files를 사용하는 경우:

      # mount temporarily the volume
      sudo mkdir -p /saptmp
      
      # If using NFSv3
      sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.90.91.5:/sapnw1 /saptmp
      # If using NFSv4.1
      sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=4.1,sec=sys,tcp 10.90.91.5:/sapnw1 /saptmp
      
      # create the SAP directories
      sudo cd /saptmp
      sudo mkdir -p usrsapNW1D02
      sudo mkdir -p usrsapNW1D03
      
      # unmount the volume and delete the temporary directory
      sudo cd ..
      sudo umount /saptmp
      sudo rmdir /saptmp
      
  3. [A] 공유 디렉터리를 만듭니다.

    sudo mkdir -p /usr/sap/NW1/D02
    sudo mkdir -p /usr/sap/NW1/D03
    
    sudo chattr +i /usr/sap/NW1/D02
    sudo chattr +i /usr/sap/NW1/D03
    
  4. [A] 스왑 공간 구성. 중앙 서비스가 포함된 대화 인스턴스를 설치하는 경우 더 많은 스왑 공간을 구성해야 합니다.

    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
    ResourceDisk.SwapSizeMB=10480
    

    에이전트를 다시 시작하여 변경 내용을 활성화합니다.

    sudo service waagent restart
    
  5. [A] PAS 및 AAS에 대한 방화벽 규칙 추가.

    # Probe and gateway port for PAS and AAS
    sudo firewall-cmd --zone=public --add-port={62002,62003,3302,3303}/tcp --permanent
    sudo firewall-cmd --zone=public --add-port={62002,62003,3303,3303}/tcp
    

SAP Netweaver PAS 인스턴스 설치

  1. [1] 클러스터 상태를 확인합니다. 설치를 위해 PAS 리소스를 구성하기 전에 ASCS 및 ERS 리소스가 구성되고 시작되었는지 확인합니다.

    sudo pcs status
    
    # Online: [ sap-cl1 sap-cl2 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl1
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl2
    
  2. [1] PAS 인스턴스에 대한 파일 시스템, 가상 IP 및 상태 프로브 리소스를 만듭니다.

    sudo pcs node standby sap-cl2
    sudo pcs resource create vip_NW1_PAS IPaddr2 ip=10.90.90.30 --group g-NW1_PAS
    sudo pcs resource create nc_NW1_PAS azure-lb port=62002 --group g-NW1_PAS
    
    # If using NFS on Azure files
    sudo pcs resource create fs_NW1_PAS Filesystem device='sapnfs.file.core.windows.net:/sapnfsafs/sapnw1/usrsapNW1D02' \
      directory='/usr/sap/NW1/D02' fstype='nfs' force_unmount=safe options='noresvport,vers=4,minorversion=1,sec=sys' \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \
      op monitor interval=200 timeout=40 \
      --group g-NW1_PAS
    
    # If using NFsv3 on Azure NetApp Files
    sudo pcs resource create fs_NW1_PAS Filesystem device='10.90.91.5:/sapnw1/usrsapNW1D02' \
      directory='/usr/sap/NW1/D02' fstype='nfs' force_unmount=safe \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \ 
      op monitor interval=200 timeout=40 \
      --group g-NW1_PAS
    
    # If using NFSv4.1 on Azure NetApp Files
    sudo pcs resource create fs_NW1_PAS Filesystem device='10.90.91.5:/sapnw1/usrsapNW1D02' \
      directory='/usr/sap/NW1/D02' fstype='nfs' force_unmount=safe options='sec=sys,vers=4.1' \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \
      op monitor interval=200 timeout=105 \
      --group g-NW1_PAS
    

    클러스터 상태가 정상이며 모든 리소스가 시작되었는지 확인합니다. 리소스가 실행되는 노드는 중요하지 않습니다.

    sudo pcs status
    
    # Node List:
    #   Node sap-cl2: standby
    #   Online: [ sap-cl1 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl1
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Started sap-cl1
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Started sap-cl1
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Started sap-cl1
    
  3. [1] 파일 시스템이 탑재된 후 /usr/sap/SID/D02 폴더의 소유권을 변경합니다.

    sudo chown nw1adm:sapsys /usr/sap/NW1/D02
    
  4. [1] SAP Netweaver PAS를 설치합니다.

    PAS에 대한 부하 분산 장치 프런트 엔드 구성의 IP 주소에 매핑되는 가상 호스트 이름을 사용하여 첫 번째 노드에 SAP NetWeaver PAS를 루트로 설치합니다. 예를 들어, sappas, 10.90.90.30 및 부하 분산 장치의 프로브에 사용한 인스턴스 번호(예: 02)를 사용합니다.

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트가 아닌 사용자가 sapinst에 연결하도록 허용할 수 있습니다.

    # Allow access to SWPM. This rule is not permanent. If you reboot the machine, you have to run the command again.
    sudo firewall-cmd --zone=public  --add-port=4237/tcp
    
    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin SAPINST_USE_HOSTNAME=<pas_virtual_hostname>
    
  5. /usr/sap/sapservices 파일을 업데이트합니다.

    sapinit 시작 스크립트에 의해 인스턴스가 시작되지 않도록 하려면 /usr/sap/sapservices 파일에서 Pacemaker가 관리하는 모든 인스턴스를 주석 처리해야 합니다.

    sudo vi /usr/sap/sapservices
    
    # On the node where PAS is installed, comment out the following lines. 
    # LD_LIBRARY_PATH=/usr/sap/NW1/D02/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/NW1/D02/exe/sapstartsrv pf=/usr/sap/NW1/SYS/profile/NW1_D02_sappas -D -u nw1adm
    
  6. [1] PAS 클러스터 리소스를 만듭니다.

    # If using NFS on Azure Files or NFSv3 on Azure NetApp Files
    pcs resource create rsc_sap_NW1_PAS02 SAPInstance InstanceName="NW1_D02_sappas" \
     START_PROFILE=/sapmnt/NW1/profile/NW1_D02_sappas \
     op monitor interval=20 timeout=60 \
     --group g-NW1_PAS
    
    # If using NFSv4.1 on Azure NetApp Files
    pcs resource create rsc_sap_NW1_PAS02 SAPInstance InstanceName="NW1_D02_sappas" \
     START_PROFILE=/sapmnt/NW1/profile/NW1_D02_sappas \
     op monitor interval=20 timeout=105 \
     --group g-NW1_PAS
    

    클러스터의 상태를 확인합니다.

    sudo pcs status
    
    # Node List:
    #   Node sap-cl2: standby
    #   Online: [ sap-cl1 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl1
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Started sap-cl1
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Started sap-cl1
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Started sap-cl1
    #      rsc_sap_NW1_PAS02 (ocf::heartbeat:SAPInstance):    Started sap-cl1
    
  7. ASCS 인스턴스가 시작된 후에만 PAS 리소스 그룹을 시작하도록 제약 조건을 구성합니다.

    sudo pcs constraint order g-NW1_ASCS then g-NW1_PAS kind=Optional symmetrical=false
    

SAP Netweaver AAS 인스턴스 설치

  1. [2] 클러스터의 상태를 확인합니다. 설치를 위해 AAS 리소스를 구성하기 전에 ASCS, ERS 및 PAS 리소스가 시작되었는지 확인합니다.

    sudo pcs status
    
    # Node List:
    #   Node sap-cl2: standby
    #   Online: [ sap-cl1 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl1
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Started sap-cl1
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Started sap-cl1
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Started sap-cl1
    #      rsc_sap_NW1_PAS02 (ocf::heartbeat:SAPInstance):    Started sap-cl1
    
  2. [2] AAS 인스턴스에 대한 파일 시스템, 가상 IP 및 상태 프로브 리소스를 만듭니다.

    sudo pcs node unstandby sap-cl2
    # Disable PAS resource as it will fail on sap-cl2 due to missing environment variables like hdbuserstore. 
    sudo pcs resource disable g-NW1_PAS
    sudo pcs node standby sap-cl1
    # Execute below command to cleanup resource, if required
    pcs resource cleanup rsc_sap_NW1_ERS01
    
    sudo pcs resource create vip_NW1_AAS IPaddr2 ip=10.90.90.31 --group g-NW1_AAS
    sudo pcs resource create nc_NW1_AAS azure-lb port=62003 --group g-NW1_AAS
    
    # If using NFS on Azure files
    sudo pcs resource create fs_NW1_AAS Filesystem device='sapnfs.file.core.windows.net:/sapnfsafs/sapnw1/usrsapNW1D03' \
      directory='/usr/sap/NW1/D03' fstype='nfs' force_unmount=safe options='noresvport,vers=4,minorversion=1,sec=sys' \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \
      op monitor interval=200 timeout=40 \
      --group g-NW1_AAS
    
    # If using NFsv3 on Azure NetApp Files
    sudo pcs resource create fs_NW1_AAS Filesystem device='10.90.91.5:/sapnw1/usrsapNW1D03' \
      directory='/usr/sap/NW1/D03' fstype='nfs' force_unmount=safe \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \ 
      op monitor interval=200 timeout=40 \
      --group g-NW1_AAS
    
    # If using NFSv4.1 on Azure NetApp Files
    sudo pcs resource create fs_NW1_AAS Filesystem device='10.90.91.5:/sapnw1/usrsapNW1D03' \
      directory='/usr/sap/NW1/D03' fstype='nfs' force_unmount=safe options='sec=sys,vers=4.1' \
      op start interval=0 timeout=60 \
      op stop interval=0 timeout=120 \
      op monitor interval=200 timeout=105 \
      --group g-NW1_AAS
    

    클러스터 상태가 정상이며 모든 리소스가 시작되었는지 확인합니다. 리소스가 실행되는 노드는 중요하지 않습니다. g-NW1_PAS 리소스 그룹이 중지되었으므로 모든 PAS 리소스가 (사용 안 함) 상태에서 중지됩니다.

    sudo pcs status
    
    # Node List:
    #   Node sap-cl1: standby
    #   Online: [ sap-cl2 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl2
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl2
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl2
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Stopped (disabled)
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Stopped (disabled)
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Stopped (disabled)
    #      rsc_sap_NW1_PAS02 (ocf::heartbeat:SAPInstance):    Stopped (disabled)
    #  Resource Group: g-NW1_AAS:
    #      vip_NW1_AAS       (ocf::heartbeat:IPaddr2):        Started sap-cl2
    #      nc_NW1_AAS        (ocf::heartbeat:azure-lb):       Started sap-cl2
    #      fs_NW1_AAS        (ocf::heartbeat:Filesystem):     Started sap-cl2
    
  3. [2] 파일 시스템이 탑재된 후 /usr/sap/SID/D03 폴더의 소유권을 변경합니다.

    sudo chown nw1adm:sapsys /usr/sap/NW1/D03
    
  4. [2] SAP Netweaver AAS를 설치합니다.

    PAS에 대한 부하 분산 장치 프런트 엔드 구성의 IP 주소에 매핑되는 가상 호스트 이름을 사용하여 SAP NetWeaver AAS를 두 번째 노드의 루트로 설치합니다. 예를 들어, sapaas, 10.90.90.31 및 부하 분산 장치의 프로브에 사용한 인스턴스 번호(예: 03)를 사용합니다.

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트가 아닌 사용자가 sapinst에 연결하도록 허용할 수 있습니다.

    # Allow access to SWPM. This rule is not permanent. If you reboot the machine, you have to run the command again.
    sudo firewall-cmd --zone=public  --add-port=4237/tcp
    
    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin SAPINST_USE_HOSTNAME=<aas_virtual_hostname>
    
  5. /usr/sap/sapservices 파일을 업데이트합니다.

    sapinit 시작 스크립트에 의해 인스턴스가 시작되지 않도록 하려면 /usr/sap/sapservices 파일에서 Pacemaker가 관리하는 모든 인스턴스를 주석 처리해야 합니다.

    sudo vi /usr/sap/sapservices
    
    # On the node where AAS is installed, comment out the following lines. 
    #LD_LIBRARY_PATH=/usr/sap/NW1/D03/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/NW1/D03/exe/sapstartsrv pf=/usr/sap/NW1/SYS/profile/NW1_D03_sapaas -D -u nw1adm
    
  6. [2] AAS 클러스터 리소스를 만듭니다.

    # If using NFS on Azure Files or NFSv3 on Azure NetApp Files
    pcs resource create rsc_sap_NW1_AAS03 SAPInstance InstanceName="NW1_D03_sapaas" \
     START_PROFILE=/sapmnt/NW1/profile/NW1_D03_sapaas \
     op monitor interval=120 timeout=60 \
     --group g-NW1_AAS
    
    # If using NFSv4.1 on Azure NetApp Files
    pcs resource create rsc_sap_NW1_AAS03 SAPInstance InstanceName="NW1_D03_sapaas" \
     START_PROFILE=/sapmnt/NW1/profile/NW1_D03_sapaas \
     op monitor interval=120 timeout=105 \
     --group g-NW1_AAS
    

    클러스터의 상태를 확인합니다.

    sudo pcs status
    
    # Node List:
    #   Node sap-cl1: standby
    #   Online: [ sap-cl2 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl2
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl2
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl2
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Stopped (disabled)
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Stopped (disabled)
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Stopped (disabled)
    #      rsc_sap_NW1_PAS02 (ocf::heartbeat:SAPInstance):    Stopped (disabled)
    #  Resource Group: g-NW1_AAS:
    #      vip_NW1_AAS       (ocf::heartbeat:IPaddr2):        Started sap-cl2
    #      nc_NW1_AAS        (ocf::heartbeat:azure-lb):       Started sap-cl2
    #      fs_NW1_AAS        (ocf::heartbeat:Filesystem):     Started sap-cl2
    #      rsc_sap_NW1_AAS03 (ocf::heartbeat:SAPInstance):    Started sap-cl2
    
  7. ASCS 인스턴스가 시작된 후에만 AAS 리소스 그룹을 시작하도록 제약 조건을 구성합니다.

    sudo pcs constraint order g-NW1_ASCS then g-NW1_AAS kind=Optional symmetrical=false
    

PAS 및 AAS 인스턴스에 대한 사후 구성

  1. [1] 모든 클러스터 노드(sap-cl1 또는 sap-cl2)에서 PAS 및 AAS를 실행하려면 두 클러스터 노드에서 <sid>adm$HOME/.hdb 콘텐츠를 복사해야 합니다.

    # Check current content of /home/nw1adm/.hdb on sap-cl1
    sap-cl1:nw1adm > ls -ltr $HOME/.hdb
    drwx------. 2 nw1adm sapsys 66 Aug  8 19:11 sappas
    drwx------. 2 nw1adm sapsys 84 Aug  8 19:12 sap-cl1
    # Check current content of /home/nw1adm/.hdb on sap-cl2
    sap-cl2:nw1adm > ls -ltr $HOME/.hdb
    total 0
    drwx------. 2 nw1adm sapsys 64 Aug  8 20:25 sap-cl2
    drwx------. 2 nw1adm sapsys 66 Aug  8 20:26 sapaas
    
    # As PAS and AAS is installed using virtual hostname, you need to copy virtual hostname directory in /home/nw1adm/.hdb
    # Copy sappas directory from sap-cl1 to sap-cl2
    sap-cl1:nw1adm > scp -r sappas nw1adm@sap-cl2:/home/nw1adm/.hdb
    # Copy sapaas directory from sap-cl2 to sap-cl1. Execute the command from the same sap-cl1 host. 
    sap-cl1:nw1adm > scp -r nw1adm@sap-cl2:/home/nw1adm/.hdb/sapaas . 
    
  2. [1] 두 노드가 모두 실행될 때마다 PAS 및 AAS 인스턴스가 동일한 노드에서 실행되지 않도록 하려면 다음 명령을 사용하여 음수 공동 배치 제약 조건을 추가합니다.

    sudo pcs constraint colocation add g-NW1_AAS with g-NW1_PAS score=-1000
    sudo pcs node unstandby sap-cl1
    sudo pcs resource enable g-NW1_PAS
    

    점수가 -1000이면 하나의 노드만 사용할 수 있는 경우 두 인스턴스가 모두 다른 노드에서 계속 실행됩니다. 이러한 상황에서 AAS 인스턴스를 중단 상태로 유지하려면 score=-INFINITY를 사용하여 이 조건을 적용할 수 있습니다.

  3. 클러스터의 상태를 확인합니다.

    sudo pcs status
    
    # Node List:
    #   Online: [ sap-cl1 sap-cl2 ]
    #
    # Full list of resources:
    #
    # rsc_st_azure    (stonith:fence_azure_arm):      Started sap-cl2
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started sap-cl2
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started sap-cl2
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started sap-cl2
    #      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started sap-cl2
    #  Resource Group: g-NW1_AERS
    #      fs_NW1_AERS        (ocf::heartbeat:Filesystem):    Started sap-cl1
    #      nc_NW1_AERS        (ocf::heartbeat:azure-lb):      Started sap-cl1
    #      vip_NW1_AERS       (ocf::heartbeat:IPaddr2):       Started sap-cl1
    #      rsc_sap_NW1_ERS01  (ocf::heartbeat:SAPInstance):   Started sap-cl1
    #  Resource Group: g-NW1_PAS:
    #      vip_NW1_PAS       (ocf::heartbeat:IPaddr2):        Started sap-cl1
    #      nc_NW1_PAS        (ocf::heartbeat:azure-lb):       Started sap-cl1
    #      fs_NW1_PAS        (ocf::heartbeat:Filesystem):     Started sap-cl1
    #      rsc_sap_NW1_PAS02 (ocf::heartbeat:SAPInstance):    Started sap-cl1
    #  Resource Group: g-NW1_AAS:
    #      vip_NW1_AAS       (ocf::heartbeat:IPaddr2):        Started sap-cl2
    #      nc_NW1_AAS        (ocf::heartbeat:azure-lb):       Started sap-cl2
    #      fs_NW1_AAS        (ocf::heartbeat:Filesystem):     Started sap-cl2
    #      rsc_sap_NW1_AAS03 (ocf::heartbeat:SAPInstance):    Started sap-cl2
    

클러스터 설정 테스트

일반적인 장애 조치(failover) 테스트를 실행하여 Pacemaker 클러스터를 철저하게 테스트합니다.