SAP 애플리케이션용 SUSE Linux Enterprise Server의 Azure VM에 있는 SAP NetWeaver에 대한 고가용성

이 문서에서는 가상 머신을 배포 및 구성하고 클러스터 프레임워크 및 고가용성 SAP NetWeaver 또는 SAP ABAP 플랫폼 기반 시스템을 설치하는 방법을 설명합니다. 예제 구성에서 ASCS 인스턴스 번호 00, ERS 인스턴스 번호 02, SAP 시스템 ID NW1을 사용합니다.

SAP 애플리케이션 15용 SLES를 새로 구현하려는 경우 간단한 탑재 구성에서 SAP ASCS/ERS에 대한 고가용성을 배포하는 것이 좋습니다. 이 문서에 설명하는 SAP 중앙 서비스 디렉터리에 대한 클러스터 제어 파일 시스템을 기반으로 하는 클래식 Pacemaker 구성은 계속 지원됩니다.

먼저 다음 SAP 참고와 문서 읽기

  • SAP Note 1928533, 다음 항목을 포함합니다.
    • SAP 소프트웨어 배포에 지원되는 Azure VM 크기 목록
    • Azure VM 크기에 대한 중요한 용량 정보
    • 지원되는 SAP 소프트웨어 및 운영 체제(OS)와 데이터베이스 조합
    • Microsoft Azure에서 Windows 및 Linux에 필요한 SAP 커널 버전
  • SAP Note 2015553는 Azure에서 SAP을 지원하는 SAP 소프트웨어 배포에 대한 필수 구성 요소를 나열합니다.
  • SAP Note 2205917에는 SAP 애플리케이션용 SUSE Linux Enterprise Server에 권장되는 OS 설정이 나와 있습니다.
  • SAP Note 1944799에는 SAP 애플리케이션용 SUSE Linux Enterprise Server에 대한 SAP HANA 지침이 나와 있습니다.
  • SAP Note 2178632는 Azure에서 SAP에 대해 보고된 모든 모니터링 메트릭에 대한 자세한 정보를 포함하고 있습니다.
  • SAP Note 2191498는 Azure에서 Linux에 필요한 SAP Host Agent 버전을 포함하고 있습니다.
  • SAP Note 2243692는 Azure에서 Linux의 SAP 라이선스에 대한 정보를 포함하고 있습니다.
  • SAP Note 1984787은 SUSE LINUX Enterprise Server 12에 대한 일반 정보를 포함하고 있습니다.
  • SAP Note 1999351은 SAP용 Azure 고급 모니터링 확장을 위한 추가 문제 해결 정보를 포함하고 있습니다.
  • SAP Community WIKI는 Linux에 필요한 모든 SAP Note를 포함하고 있습니다.
  • Linux에서 SAP용 Azure Virtual Machines 계획 및 구현
  • Linux에서 SAP용 Azure Virtual Machines 배포
  • Linux에서 SAP용 Azure Virtual Machines DBMS 배포
  • SUSE SAP HA 모범 사례 가이드 이 가이드는 Netweaver HA 및 SAP HANA 시스템 복제 온-프레미스를 설정하는 데 필요한 모든 정보를 포함하고 있습니다. 이 가이드를 일반 기준으로 사용하세요. 여기서 훨씬 더 자세한 정보를 제공합니다.
  • SUSE High Availability Extension 12 SP3 릴리스 정보

개요

SAP NetWeaver의 가용성을 높이려면 NFS 서버가 필요합니다. NFS 서버는 별도의 클러스터에서 구성되며, 여러 SAP 시스템에서 사용할 수 있습니다.

SAP NetWeaver High Availability overview

NFS 서버, SAP NetWeaver ASCS, SAP NetWeaver SCS, SAP NetWeaver ERS 및 SAP HANA 데이터베이스는 가상 호스트 이름 및 가상 IP 주소를 사용합니다. Azure에서는 가상 IP 주소를 사용하려면 부하 분산 장치가 필요합니다. 표준 부하 분산 장치를 사용하는 것이 좋습니다. 제시된 구성은 다음이 포함된 부하 분산 장치를 보여 줍니다.

  • ASCS용 프런트 엔드 IP 주소 10.0.0.7
  • ERS용 프런트 엔드 IP 주소 10.0.0.8
  • ASCS용 프로브 포트 62000
  • ERS용 프로브 포트 62101

고가용성 NFS 서버 설정

참고 항목

가용성이 높은 SAP 시스템에 공유 데이터를 저장하기 위한 Azure Files의 NFS 또는 NFS ANF 볼륨과 같은 Azure 자사 NFS 서비스 중 하나를 배포하는 것이 좋습니다. NFS 클러스터를 활용하여 SAP 참조 아키텍처를 덜 강조하고 있다는 점에 유의합니다.
네이티브 NFS 서비스를 사용하는 SAP NW 고가용성 SAP 시스템에 대한 SAP 구성 가이드는 다음과 같습니다.

SAP NetWeaver에는 전송 및 프로필 디렉터리에 대한 공유 스토리지가 필요합니다. SAP NetWeaver용 NFS 서버를 설정하는 방법은 SUSE Linux Enterprise Server의 Azure VM에 있는 NFS의 고가용성을 참조하세요.

인프라 준비

SAP 인스턴스의 리소스 에이전트는 SAP 애플리케이션의 SUSE Linux Enterprise Server에 포함되어 있습니다. SAP 애플리케이션 12 또는 15용 SUSE Linux Enterprise Server에 대한 이미지는 Azure Marketplace에서 사용할 수 있습니다. 이미지를 사용하여 새 VM을 배포할 수 있습니다.

Azure Portal을 통해 수동으로 Linux VM 배포

이 문서에서는 리소스 그룹, Azure Virtual Network 및 서브넷을 이미 배포했다고 가정합니다.

SAP 애플리케이션용 SLES 이미지를 사용하여 가상 머신을 배포합니다. SAP 시스템에 지원되는 적합한 버전의 SLES 이미지를 선택합니다. 가상 머신 확장 집합, 가용성 영역 또는 가용성 집합 같은 배포 옵션 중 하나에서 VM을 선택합니다.

Azure Load Balancer 구성

VM 구성 중에 네트워킹 섹션에서 기존 부하 분산 장치를 만들거나 선택할 수 있는 옵션이 있습니다. 아래 단계에 따라 SAP ASCS 및 SAP ERS의 고가용성 설정에 대한 표준 부하 분산 장치를 구성합니다.

부하 분산 장치 만들기 가이드를 따라 Azure Portal을 사용하여 고가용성 SAP 시스템용 표준 Load Balancer를 설정합니다. 부하 분산 장치를 설정하는 동안 다음 사항을 고려합니다.

  1. 프런트 엔드 IP 구성: 두 개의 프런트 엔드 IP(ASCS용 및 ERS용)를 만듭니다. ASCS/ERS 가상 머신과 동일한 가상 네트워크 및 서브넷을 선택합니다.
  2. 백 엔드 풀: 백 엔드 풀을 만들고 ASCS 및 ERS VM을 추가합니다.
  3. 인바운드 규칙: ASCS용과 ERS용으로 하나씩 두 개의 부하 분산 규칙을 만듭니다. 두 부하 분산 규칙 모두에 대해 동일한 단계를 수행합니다.
    • 프런트 엔드 IP 주소: 프런트 엔드 IP 선택
    • 백 엔드 풀: 백 엔드 풀 선택
    • "고가용성 포트" 확인
    • 프로토콜: TCP
    • 상태 프로브: 아래 세부 정보로 상태 프로브 만들기(ASCS 및 ERS 모두에 적용)
      • 프로토콜: TCP
      • 포트: [예: ASCS의 경우 620<인스턴스 번호>, ERS의 경우 621<인스턴스 번호>]
      • 간격: 5
      • 프로브 임계값: 2
    • 유휴 제한 시간(분): 30
    • "부동 IP 사용" 확인

참고 항목

상태 프로브 구성 속성 numberOfProbes(포털에서 “비정상 임계값”으로 알려짐)는 적용되지 않습니다. 따라서 성공하거나 실패한 연속 프로브 수를 제어하려면 "probeThreshold" 속성을 2로 설정합니다. 현재 Azure Portal을 사용하여 이 속성을 설정할 수 없으므로 Azure CLI 또는 PowerShell 명령을 사용합니다.

Important

부동 IP는 부하 분산 시나리오의 NIC 보조 IP 구성에서 지원되지 않습니다. 자세한 내용은 Azure Load Balancer 제한 사항을 참조하세요. VM에 대한 추가 IP 주소가 필요한 경우 두 번째 NIC를 배포합니다.

참고 항목

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

Important

  • 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 – 업데이트가 필요하나요?를 참조하세요.

(A)SCS 설정

다음으로 SAP ASCS 및 ERS 인스턴스를 준비하고 설치합니다.

Pacemaker 클러스터 만들기

Azure의 SUSE Linux Enterprise Server에서 Pacemaker 설정 단계에 따라 이 (A)SCS 서버에 대한 기본 Pacemaker 클러스터를 만듭니다.

설치

다음 항목에는 접두사 [A] - 모든 노드에 적용, [1] - 노드 1에만 적용 1 또는 [2] - 노드 2에만 적용이 지정됩니다.

  1. [A] SUSE 커넥터 설치

    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
    <b>Version        : 3.0.0-2.2</b>
    Arch           : noarch
    Vendor         : SUSE LLC <https://www.suse.com/>
    Support Level  : Level 3
    Installed Size : 41.6 KiB
    <b>Installed      : Yes</b>
    Status         : up-to-date
    Source package : sap-suse-cluster-connector-3.0.0-2.2.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
    
    # Insert the following lines to /etc/hosts. Change the IP address and hostname to match your environment
    # IP address of the load balancer frontend configuration for NFS
    10.0.0.4 nw1-nfs
    # IP address of the load balancer frontend configuration for SAP NetWeaver ASCS
    10.0.0.7 nw1-ascs
    # IP address of the load balancer frontend configuration for SAP NetWeaver ASCS ERS
    10.0.0.8 nw1-aers
    # IP address of the load balancer frontend configuration for database
    10.0.0.13 nw1-db
    

SAP NetWeaver 설치 준비

  1. [A] 공유 디렉터리 만들기

    sudo mkdir -p /sapmnt/NW1
    sudo mkdir -p /usr/sap/trans
    sudo mkdir -p /usr/sap/NW1/SYS
    sudo mkdir -p /usr/sap/NW1/ASCS00
    sudo mkdir -p /usr/sap/NW1/ERS02
    
    sudo chattr +i /sapmnt/NW1
    sudo chattr +i /usr/sap/trans
    sudo chattr +i /usr/sap/NW1/SYS
    sudo chattr +i /usr/sap/NW1/ASCS00
    sudo chattr +i /usr/sap/NW1/ERS02
    
  2. [A] autofs 구성

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

    아래 코드를 사용하여 파일을 만듭니다.

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/NW1 -nfsvers=4,nosymlink,sync nw1-nfs:/NW1/sapmntsid
    /usr/sap/trans -nfsvers=4,nosymlink,sync nw1-nfs:/NW1/trans
    /usr/sap/NW1/SYS -nfsvers=4,nosymlink,sync nw1-nfs:/NW1/sidsys
    

    autofs를 다시 시작하여 새 공유를 탑재합니다.

    sudo systemctl enable autofs
    sudo service autofs restart
    
  3. [A] 스왑 파일 구성

    Azure Linux VM용 SWAP 파일 만들기에 정의된 대로 스왑 파일 만들기

    #!/bin/sh
    
    # Percent of space on the ephemeral disk to dedicate to swap. Here 30% is being used. Modify as appropriate.
    PCT=0.3
    
    # Location of swap file. Modify as appropriate based on location of ephemeral disk.
    LOCATION=/mnt
    
    if [ ! -f ${LOCATION}/swapfile ]
    then
    
        # Get size of the ephemeral disk and multiply it by the percent of space to allocate
        size=$(/bin/df -m --output=target,avail | /usr/bin/awk -v percent="$PCT" -v pattern=${LOCATION} '$0 ~ pattern {SIZE=int($2*percent);print SIZE}')
        echo "$size MB of space allocated to swap file"
    
         # Create an empty file first and set correct permissions
        /bin/dd if=/dev/zero of=${LOCATION}/swapfile bs=1M count=$size
        /bin/chmod 0600 ${LOCATION}/swapfile
    
        # Make the file available to use as swap
        /sbin/mkswap ${LOCATION}/swapfile
    fi
    
    # Enable swap
    /sbin/swapon ${LOCATION}/swapfile
    /sbin/swapon -a
    
    # Display current swap status
    /sbin/swapon -s
    

    파일을 실행 가능하게 만듭니다.

    chmod +x /var/lib/cloud/scripts/per-boot/swap.sh
    

    VM을 중지하고 시작합니다. VM을 중지하고 시작하는 것은 SWAP 파일을 만든 후에만 처음에만 필요합니다.

SAP NetWeaver ASCS/ERS 설치

  1. [1] ASCS 인스턴스에 대한 가상 IP 리소스 및 상태 프로브 만들기

    Important

    최근 테스트 결과, 백로그와 하나의 연결만 처리하는 제한으로 인해 netcat이 요청에 응답하지 않는 것으로 확인되었습니다. netcat 리소스가 Azure Load Balancer 요청 수신을 중지하고 부동 IP를 사용할 수 없게 됩니다.
    기존 Pacemaker 클러스터의 경우 netcat을 socat으로 교체할 것을 권장했습니다. 현재는 다음 패키지 버전 요구 사항과 함께 패키지 리소스 에이전트의 일부인 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 클러스터의 경우 Azure Load-Balancer 감지 강화의 설명에 따라 socat을 사용하도록 구성을 이미 변경한 경우 즉시 azure-lb 리소스 에이전트로 전환할 필요가 없습니다.

    sudo crm node standby nw1-cl-1
    
    sudo crm configure primitive fs_NW1_ASCS Filesystem device='nw1-nfs:/NW1/ASCS' directory='/usr/sap/NW1/ASCS00' fstype='nfs4' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=40s
    
    sudo crm configure primitive vip_NW1_ASCS IPaddr2 \
      params ip=10.0.0.7 \
      op monitor interval=10 timeout=20
    
    sudo crm configure primitive nc_NW1_ASCS azure-lb port=62000 \
      op monitor timeout=20s interval=10
    
    sudo crm configure group g-NW1_ASCS fs_NW1_ASCS nc_NW1_ASCS vip_NW1_ASCS \
       meta resource-stickiness=3000
    

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

    sudo crm_mon -r
    
    # Node nw1-cl-1: standby
    # Online: [ nw1-cl-0 ]
    # 
    # Full list of resources:
    # 
    # stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
    
  2. [1] SAP NetWeaver ASCS 설치

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

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트 권한이 없는 사용자의 sapinst 연결을 허용할 수 있습니다.

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

    설치에서 /usr/sap/NW1/ASCS00에 하위 폴더를 만들지 못하면 ASCS00 폴더의 소유자와 그룹을 설정하고 다시 시도합니다.

    chown nw1adm /usr/sap/NW1/ASCS00
    chgrp sapsys /usr/sap/NW1/ASCS00
    
  3. [1] ERS 인스턴스에 대한 가상 IP 리소스 및 상태 검사 프로브 만들기

    sudo crm node online nw1-cl-1
    sudo crm node standby nw1-cl-0
    
    sudo crm configure primitive fs_NW1_ERS Filesystem device='nw1-nfs:/NW1/ASCSERS' directory='/usr/sap/NW1/ERS02' fstype='nfs4' \
      op start timeout=60s interval=0 \
      op stop timeout=60s interval=0 \
      op monitor interval=20s timeout=40s
    
    sudo crm configure primitive vip_NW1_ERS IPaddr2 \
      params ip=10.0.0.8 \
      op monitor interval=10 timeout=20
    
    sudo crm configure primitive nc_NW1_ERS azure-lb port=62102 \
      op monitor timeout=20s interval=10
    
    sudo crm configure group g-NW1_ERS fs_NW1_ERS nc_NW1_ERS vip_NW1_ERS
    

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

    sudo crm_mon -r
    
    # Node nw1-cl-0: standby
    # Online: [ nw1-cl-1 ]
    # 
    # Full list of resources:
    #
    # stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
    #  Resource Group: g-NW1_ASCS
    #      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
    #      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
    #      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
    #  Resource Group: g-NW1_ERS
    #      fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
    #      nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
    #      vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
    
  4. [2] SAP NetWeaver ERS 설치

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

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트 권한이 없는 사용자의 sapinst 연결을 허용할 수 있습니다.

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

    참고 항목

    SWPM SP 20 PL 05 이상을 사용합니다. 그 이전 버전은 권한을 올바르게 설정하지 않으므로 설치가 실패합니다.

    설치에서 /usr/sap/NW1/ERS02에 하위 폴더를 만들지 못하면 ERS02 폴더의 소유자와 그룹을 설정하고 다시 시도합니다.

    chown nw1adm /usr/sap/NW1/ERS02
    chgrp sapsys /usr/sap/NW1/ERS02
    
  5. [1] ASCS/SCS 및 ERS 인스턴스 프로필 조정

    • ASCS/SCS 프로필

      sudo vi /sapmnt/NW1/profile/NW1_ASCS00_nw1-ascs
      
      # 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 Note 1410736에 설명된 대로 설정해야 합니다.

    • ERS 프로필

      sudo vi /sapmnt/NW1/profile/NW1_ERS02_nw1-aers
      
      # 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 간의 통신은 소프트웨어 부하 분산 장치를 통해 라우팅됩니다. 부하 분산 장치는 구성 가능한 시간 제한이 지나면 비활성 연결을 끊습니다. 이런 상황을 방지하려면 ENSA1 사용 시에는 SAP NetWeaver ASCS/SCS 프로필에 매개 변수를 설정하고, ENSA1/ENSA2 양쪽의 경우에는 모든 SAP 서버에서 Linux 시스템 keepalive 설정을 변경합니다. 자세한 내용은 SAP Note 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 nw1adm
    
  8. [1] sapservice 파일에 ASCS 및 ERS SAP 서비스 추가

    ASCS 서비스 항목을 두 번째 노드에 추가하고 ERS 서비스 항목을 첫 번째 노드에 복사합니다.

    cat /usr/sap/sapservices | grep ASCS00 | sudo ssh nw1-cl-1 "cat >>/usr/sap/sapservices"
    sudo ssh nw1-cl-1 "cat /usr/sap/sapservices" | grep ERS02 | sudo tee -a /usr/sap/sapservices
    
  9. [1] SAP 클러스터 리소스 만들기

    ENSA1 또는 ENSA2 시스템을 실행하는지 여부에 따라 해당 탭을 선택하여 리소스를 정의합니다. SAP는 SAP NetWeaver 7.52에서 복제를 포함하여 ENSA2에 대한 지원을 도입했습니다. ABAP 플랫폼 1809부터 ENSA2가 기본적으로 설치됩니다. ENSA2 지원은 SAP Note 2630416을 참조하세요.

    sudo crm configure property maintenance-mode="true"
    
    sudo crm configure primitive rsc_sap_NW1_ASCS00 SAPInstance \
      operations \$id=rsc_sap_NW1_ASCS00-operations \
      op monitor interval=11 timeout=60 on-fail=restart \
      params InstanceName=NW1_ASCS00_nw1-ascs START_PROFILE="/sapmnt/NW1/profile/NW1_ASCS00_nw1-ascs" \
      AUTOMATIC_RECOVER=false \
      meta resource-stickiness=5000 failure-timeout=60 migration-threshold=1 priority=10
    
    sudo crm configure primitive rsc_sap_NW1_ERS02 SAPInstance \
      operations \$id=rsc_sap_NW1_ERS02-operations \
      op monitor interval=11 timeout=60 on-fail=restart \
      params InstanceName=NW1_ERS02_nw1-aers START_PROFILE="/sapmnt/NW1/profile/NW1_ERS02_nw1-aers" AUTOMATIC_RECOVER=false IS_ERS=true \
      meta priority=1000
    
    sudo crm configure modgroup g-NW1_ASCS add rsc_sap_NW1_ASCS00
    sudo crm configure modgroup g-NW1_ERS add rsc_sap_NW1_ERS02
    
    sudo crm configure colocation col_sap_NW1_no_both -5000: g-NW1_ERS g-NW1_ASCS
    sudo crm configure location loc_sap_NW1_failover_to_ers rsc_sap_NW1_ASCS00 rule 2000: runs_ers_NW1 eq 1
    sudo crm configure order ord_sap_NW1_first_start_ascs Optional: rsc_sap_NW1_ASCS00:start rsc_sap_NW1_ERS02:stop symmetrical=false
    
    sudo crm_attribute --delete --name priority-fencing-delay
    
    sudo crm node online nw1-cl-0
    sudo crm configure property maintenance-mode="false"
    

이전 버전에서 업그레이드하고 큐에 넣기 서버 2로 전환하는 경우 SAP Note 2641019를 참조하세요.

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

sudo crm_mon -r
 
# Online: [ nw1-cl-0 nw1-cl-1 ]
#
# Full list of resources:
#
# stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
#  Resource Group: g-NW1_ASCS
#      fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
#      nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
#      vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
#      rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
#  Resource Group: g-NW1_ERS
#      fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
#      nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
#      vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
#      rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0

SAP NetWeaver 애플리케이션 서버 준비

일부 데이터베이스에서는 데이터베이스 인스턴스 설치가 애플리케이션 서버에서 실행되어야 합니다. 이러한 경우 애플리케이션 서버 가상 머신을 사용할 수 있도록 준비합니다.

아래 단계에서는 ASCS/SCS 및 HANA 서버와 다른 서버에 애플리케이션 서버를 설치한다고 가정합니다. 그 외의 경우에는 호스트 이름 확인을 구성하는 단계 등 아래의 일부 단계를 수행할 필요가 없습니다.

  1. 운영 체제 구성

    더티 캐시의 크기를 줄입니다. 자세한 내용은 큰 RAM이 있는 SLES 11/12 서버의 쓰기 성능 저하를 참조하세요.

    sudo vi /etc/sysctl.conf
    
    # Change/set the following settings
    vm.dirty_bytes = 629145600
    vm.dirty_background_bytes = 314572800
    
  2. 호스트 이름 확인 설정

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

    sudo vi /etc/hosts
    

    다음 줄을 /etc/hosts에 삽입합니다. 환경에 맞게 IP 주소와 호스트 이름 변경

    # IP address of the load balancer frontend configuration for NFS
    10.0.0.4 nw1-nfs
    # IP address of the load balancer frontend configuration for SAP NetWeaver ASCS/SCS
    10.0.0.7 nw1-ascs
    # IP address of the load balancer frontend configuration for SAP NetWeaver ERS
    10.0.0.8 nw1-aers
    # IP address of the load balancer frontend configuration for database
    10.0.0.13 nw1-db
    # IP address of all application servers
    10.0.0.20 nw1-di-0
    10.0.0.21 nw1-di-1
    
  3. sapmnt 디렉터리를 만듭니다.

    sudo mkdir -p /sapmnt/NW1
    sudo mkdir -p /usr/sap/trans
    
    sudo chattr +i /sapmnt/NW1
    sudo chattr +i /usr/sap/trans
    
  4. autofs를 구성합니다.

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

    다음 코드를 사용하여 새 파일을 만듭니다.

    sudo vi /etc/auto.direct
    
    # Add the following lines to the file, save and exit
    /sapmnt/NW1 -nfsvers=4,nosymlink,sync nw1-nfs:/NW1/sapmntsid
    /usr/sap/trans -nfsvers=4,nosymlink,sync nw1-nfs:/NW1/trans
    

    autofs를 다시 시작하여 새 공유를 탑재합니다.

    sudo systemctl enable autofs
    sudo service autofs restart
    
  5. 스왑 파일을 구성합니다.

    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를 설치하는 방법에 대한 자세한 내용은 Azure VM(Virtual Machines)의 SAP HANA 고가용성을 참조하세요. 지원되는 데이터베이스 목록은 SAP Note 1928533을 참조하세요.

  1. SAP 데이터베이스 인스턴스 설치 실행

    데이터베이스에 대한 부하 분산 장치 프런트 엔드 구성의 IP 주소(예 : nw1-db10.0.0.13)에 매핑되는 가상 호스트 이름을 사용하여 SAP NetWeaver 데이터베이스 인스턴스를 루트로 설치합니다.

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트 권한이 없는 사용자의 sapinst 연결을 허용할 수 있습니다.

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

SAP NetWeaver 애플리케이션 서버 설치

다음 단계에 따라 SAP 애플리케이션 서버를 설치합니다.

  1. 애플리케이션 서버 준비

    위에 있는 SAP NetWeaver 애플리케이션 서버 준비 챕터의 단계에 따라 애플리케이션 서버를 준비합니다.

  2. SAP NetWeaver 애플리케이션 서버 설치

    기본 또는 추가 SAP NetWeaver 애플리케이션 서버를 설치합니다.

    sapinst 매개 변수 SAPINST_REMOTE_ACCESS_USER를 사용하면 루트 권한이 없는 사용자의 sapinst 연결을 허용할 수 있습니다.

    sudo <swpm>/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin SAPINST_USE_HOSTNAME=virtual_hostname
    
  3. SAP HANA 보안 저장소 업데이트

    설치한 SAP HANA System Replication의 가상 이름을 가리키도록 SAP HANA 보안 저장소를 업데이트합니다.

    다음 명령을 실행하여 항목을 나열합니다.

    hdbuserstore List
    

    이 경우 모든 항목을 나열해야 하며 다음과 비슷합니다.

    DATA FILE       : /home/nw1adm/.hdb/nw1-di-0/SSFS_HDB.DAT
    KEY FILE        : /home/nw1adm/.hdb/nw1-di-0/SSFS_HDB.KEY
    
    KEY DEFAULT
      ENV : 10.0.0.14:30313
      USER: SAPABAP1
      DATABASE: HN1
    

    출력은 기본 항목의 IP 주소가 부하 분산 장치의 IP 주소가 아니라 가상 머신을 가리키고 있음을 나타냅니다. 이 항목은 부하 분산 장치의 가상 호스트 이름을 가리키도록 변경해야 합니다. 동일한 포트(위 출력의 30313) 및 데이터베이스 이름(위 출력의 HN1)을 사용해야 합니다.

    su - nw1adm
    hdbuserstore SET DEFAULT nw1-db:30313@HN1 SAPABAP1 <password of ABAP schema>
    

클러스터 설정 테스트

다음 테스트는 SUSE의 모범 사례 가이드에서 테스트 사례를 복사한 것입니다. 편의를 위해 복사됩니다. 또한 항상 모범 사례 가이드를 읽고 추가되었을 수 있는 모든 추가 테스트를 수행해야 합니다.

  1. HAGetFailoverConfig, HACheckConfig 및 HACheckFailoverConfig 테스트

    ASCS 인스턴스를 현재 실행 중인 노드에서 <sapsid>adm으로 다음 명령을 실행합니다. 이러한 명령이 “실패: 메모리 부족”을 나타내며 실패할 경우 호스트 이름의 대시 때문일 수 있습니다. 이것은 알려진 문제로, SUSE에서는 sap-suse-cluster-connector 패키지에서 이 문제를 수정할 예정입니다.

    nw1-cl-0:nw1adm 54> sapcontrol -nr 00 -function HAGetFailoverConfig
    
    # 15.08.2018 13:50:36
    # HAGetFailoverConfig
    # OK
    # HAActive: TRUE
    # HAProductVersion: Toolchain Module
    # HASAPInterfaceVersion: Toolchain Module (sap_suse_cluster_connector 3.0.1)
    # HADocumentation: https://www.suse.com/products/sles-for-sap/resource-library/sap-best-practices/
    # HAActiveNode:
    # HANodes: nw1-cl-0, nw1-cl-1
    
    nw1-cl-0:nw1adm 55> sapcontrol -nr 00 -function HACheckConfig
    
    # 15.08.2018 14:00:04
    # HACheckConfig
    # OK
    # state, category, description, comment
    # SUCCESS, SAP CONFIGURATION, Redundant ABAP instance configuration, 2 ABAP instances detected
    # SUCCESS, SAP CONFIGURATION, Redundant Java instance configuration, 0 Java instances detected
    # SUCCESS, SAP CONFIGURATION, Enqueue separation, All Enqueue server separated from application server
    # SUCCESS, SAP CONFIGURATION, MessageServer separation, All MessageServer separated from application server
    # SUCCESS, SAP CONFIGURATION, ABAP instances on multiple hosts, ABAP instances on multiple hosts detected
    # SUCCESS, SAP CONFIGURATION, Redundant ABAP SPOOL service configuration, 2 ABAP instances with SPOOL service detected
    # SUCCESS, SAP STATE, Redundant ABAP SPOOL service state, 2 ABAP instances with active SPOOL service detected
    # SUCCESS, SAP STATE, ABAP instances with ABAP SPOOL service on multiple hosts, ABAP instances with active ABAP SPOOL service on multiple hosts detected
    # SUCCESS, SAP CONFIGURATION, Redundant ABAP BATCH service configuration, 2 ABAP instances with BATCH service detected
    # SUCCESS, SAP STATE, Redundant ABAP BATCH service state, 2 ABAP instances with active BATCH service detected
    # SUCCESS, SAP STATE, ABAP instances with ABAP BATCH service on multiple hosts, ABAP instances with active ABAP BATCH service on multiple hosts detected
    # SUCCESS, SAP CONFIGURATION, Redundant ABAP DIALOG service configuration, 2 ABAP instances with DIALOG service detected
    # SUCCESS, SAP STATE, Redundant ABAP DIALOG service state, 2 ABAP instances with active DIALOG service detected
    # SUCCESS, SAP STATE, ABAP instances with ABAP DIALOG service on multiple hosts, ABAP instances with active ABAP DIALOG service on multiple hosts detected
    # SUCCESS, SAP CONFIGURATION, Redundant ABAP UPDATE service configuration, 2 ABAP instances with UPDATE service detected
    # SUCCESS, SAP STATE, Redundant ABAP UPDATE service state, 2 ABAP instances with active UPDATE service detected
    # SUCCESS, SAP STATE, ABAP instances with ABAP UPDATE service on multiple hosts, ABAP instances with active ABAP UPDATE service on multiple hosts detected
    # SUCCESS, SAP STATE, SCS instance running, SCS instance status ok
    # SUCCESS, SAP CONFIGURATION, SAPInstance RA sufficient version (nw1-ascs_NW1_00), SAPInstance includes is-ers patch
    # SUCCESS, SAP CONFIGURATION, Enqueue replication (nw1-ascs_NW1_00), Enqueue replication enabled
    # SUCCESS, SAP STATE, Enqueue replication state (nw1-ascs_NW1_00), Enqueue replication active
    
    nw1-cl-0:nw1adm 56> sapcontrol -nr 00 -function HACheckFailoverConfig
    
    # 15.08.2018 14:04:08
    # HACheckFailoverConfig
    # OK
    # state, category, description, comment
    # SUCCESS, SAP CONFIGURATION, SAPInstance RA sufficient version, SAPInstance includes is-ers patch
    
  2. 수동으로 ASCS 인스턴스 마이그레이션

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    

    루트 권한으로 다음 명령을 실행하여 ASCS 인스턴스를 마이그레이션합니다.

    nw1-cl-0:~ # crm resource migrate rsc_sap_NW1_ASCS00 force
    # INFO: Move constraint created for rsc_sap_NW1_ASCS00
    
    nw1-cl-0:~ # crm resource unmigrate rsc_sap_NW1_ASCS00
    # INFO: Removed migration constraints for rsc_sap_NW1_ASCS00
    
    # Remove failed actions for the ERS that occurred as part of the migration
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    
  3. HAFailoverToNode 테스트

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    ASCS 인스턴스를 마이그레이션하려면 다음 명령을 <sapsid>adm으로 실행합니다.

    nw1-cl-0:nw1adm 55> sapcontrol -nr 00 -host nw1-ascs -user nw1adm <password> -function HAFailoverToNode ""
    
    # run as root
    # Remove failed actions for the ERS that occurred as part of the migration
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    # Remove migration constraints
    nw1-cl-0:~ # crm resource clear rsc_sap_NW1_ASCS00
    #INFO: Removed migration constraints for rsc_sap_NW1_ASCS00
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    
  4. 노드 작동 중단 시뮬레이트

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-0
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    

    ASCS 인스턴스를 실행 중인 노드에서 루트 권한으로 다음 명령을 실행합니다.

    nw1-cl-0:~ # echo b > /proc/sysrq-trigger
    

    SBD를 사용하는 경우 Pacemaker는 종료된 노드에서 자동으로 시작되지 않아야 합니다. 노드가 다시 시작된 후의 상태는 다음과 같습니다.

    Online: [ nw1-cl-1 ]
    OFFLINE: [ nw1-cl-0 ]
    
    Full list of resources:
    
    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    
    Failed Actions:
    * rsc_sap_NW1_ERS02_monitor_11000 on nw1-cl-1 'not running' (7): call=219, status=complete, exitreason='none',
        last-rc-change='Wed Aug 15 14:38:38 2018', queued=0ms, exec=0ms
    

    다음 명령을 사용하여 종료된 노드에서 Pacemaker를 시작하고, SBD 메시지를 정리하고, 실패한 리소스를 정리합니다.

    # run as root
    # list the SBD device(s)
    nw1-cl-0:~ # cat /etc/sysconfig/sbd | grep SBD_DEVICE=
    # SBD_DEVICE="/dev/disk/by-id/scsi-36001405772fe8401e6240c985857e116;/dev/disk/by-id/scsi-36001405034a84428af24ddd8c3a3e9e1;/dev/disk/by-id/scsi-36001405cdd5ac8d40e548449318510c3"
    
    nw1-cl-0:~ # sbd -d /dev/disk/by-id/scsi-36001405772fe8401e6240c985857e116 -d /dev/disk/by-id/scsi-36001405034a84428af24ddd8c3a3e9e1 -d /dev/disk/by-id/scsi-36001405cdd5ac8d40e548449318510c3 message nw1-cl-0 clear
    
    nw1-cl-0:~ # systemctl start pacemaker
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ASCS00
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    
  5. 네트워크 통신 차단

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    방화벽 규칙을 실행하여 노드 중 하나에서 통신을 차단합니다.

    # Execute iptable rule on nw1-cl-0 (10.0.0.5) to block the incoming and outgoing traffic to nw1-cl-1 (10.0.0.6)
    iptables -A INPUT -s 10.0.0.6 -j DROP; iptables -A OUTPUT -d 10.0.0.6 -j DROP
    

    클러스터 노드가 서로 통신할 수 없는 경우, 두뇌가 분리되는 시나리오가 발생할 위험이 있습니다. 이러한 상황에서는 클러스터 노드가 동시에 서로 펜싱을 시도하여 펜싱 경쟁이 발생합니다.

    펜싱 디바이스를 구성할 때는 pcmk_delay_max 속성을 구성하는 것이 좋습니다. 따라서 split-brain 시나리오의 경우 클러스터는 각 노드의 펜싱 작업에 pcmk_delay_max 값까지 임의 지연을 도입합니다. 지연 시간이 가장 짧은 노드가 펜싱을 위해 선택됩니다.

    또한 ENSA 2 구성에 split-brain 시나리오에서 다른 노드보다 ASCS 리소스를 호스팅하는 노드의 우선순위를 지정하려면 클러스터에서 priority-fencing-delay 속성을 구성하는 것이 좋습니다. priority-fencing-delay 속성을 활성화하면 클러스터가 ASCS 리소스를 호스팅하는 노드에 펜싱 작업에 추가 지연을 도입하여 ASCS 노드가 펜싱 경쟁에서 승리할 수 있습니다.

    아래 명령을 실행하여 방화벽 규칙을 삭제합니다.

    # If the iptables rule set on the server gets reset after a reboot, the rules will be cleared out. In case they have not been reset, please proceed to remove the iptables rule using the following command.
    iptables -D INPUT -s 10.0.0.6 -j DROP; iptables -D OUTPUT -d 10.0.0.6 -j DROP
    
  6. ASCS 인스턴스의 수동 다시 시작 테스트

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    예를 들어 트랜잭션 su01에서 사용자를 편집하여 큐에 넣기 잠금을 만듭니다. ASCS 인스턴스를 실행 중인 노드에서 <sapsid>adm으로 다음 명령을 실행합니다. 이러한 명령은 ASCS 인스턴스를 중지했다가 다시 시작합니다. 큐에 넣기 서버 1 아키텍처를 사용하는 경우 이 테스트에서 큐에 넣기 잠금이 손실될 것으로 예상됩니다. 큐에 넣기 서버 2 아키텍처를 사용하는 경우 큐에 넣기가 유지됩니다.

    nw1-cl-1:nw1adm 54> sapcontrol -nr 00 -function StopWait 600 2
    

    ASCS 인스턴스는 이제 Pacemaker에서 사용되지 않도록 설정됩니다.

    rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Stopped (disabled)
    

    동일한 노드에서 ASCS 인스턴스를 다시 시작합니다.

    nw1-cl-1:nw1adm 54> sapcontrol -nr 00 -function StartWait 600 2
    

    트랜잭션 su01의 큐에 넣기 잠금이 손실되므로 백 엔드를 다시 설정했어야 합니다. 테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    
  7. 메시지 서버 프로세스 종료

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    루트 권한으로 다음 명령을 실행하여 메시지 서버 프로세스를 확인한 후 종료합니다.

    nw1-cl-1:~ # pgrep -f ms.sapNW1 | xargs kill -9
    

    메시지 서버를 한 번만 종료하면 sapstart에 의해 다시 시작됩니다. 충분히 자주 종료하면 Pacemaker는 ENSA1의 경우 ASCS 인스턴스를 다른 노드로 이동합니다. 테스트 후에 다음 명령을 루트 권한으로 실행하여 ASCS 및 ERS 인스턴스의 리소스 상태를 정리합니다.

    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ASCS00
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    
  8. 큐에 넣기 서버 프로세스 종료

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
    

    ASCS 인스턴스를 실행 중인 노드에서 루트 권한으로 다음 명령을 실행하여 큐에 넣기 서버를 종료합니다.

    nw1-cl-0:~ # 
    #If using ENSA1
    pgrep -f en.sapNW1 | xargs kill -9
    #If using ENSA2
    pgrep -f enq.sapNW1 | xargs kill -9
    

    ENSA1의 경우 ASCS 인스턴스는 즉시 다른 노드로 장애 조치(Failover)되어야 합니다. 또한 ASCS 인스턴스가 시작된 후 ERS 인스턴스도 장애 조치(Failover)되어야 합니다. 테스트 후에 다음 명령을 루트 권한으로 실행하여 ASCS 및 ERS 인스턴스의 리소스 상태를 정리합니다.

    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ASCS00
    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    
  9. 큐에 넣기 복제 서버 프로세스 종료

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    ERS 인스턴스를 실행 중인 노드에서 루트 권한으로 다음 명령을 실행하여 큐에 넣기 복제 서버 프로세스를 종료합니다.

    nw1-cl-0:~ # pgrep -f er.sapNW1 | xargs kill -9
    

    이 명령을 한 번만 실행하는 경우 sapstart가 프로세스 다시 시작합니다. 충분히 자주 실행하면 sapstart가 해당 프로세스를 다시 시작하지 않으며 리소스는 중지된 상태가 됩니다. 테스트 후에 다음 명령을 루트 권한으로 실행하여 ERS 인스턴스의 리소스 상태를 정리합니다.

    nw1-cl-0:~ # crm resource cleanup rsc_sap_NW1_ERS02
    

    테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    
  10. 큐에 넣기 sapstartsrv 프로세스 종료

    테스트 시작 전 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

    ASCS를 실행 중인 노드에서 루트 권한으로 다음 명령을 실행합니다.

    nw1-cl-1:~ # pgrep -fl ASCS00.*sapstartsrv
    # 59545 sapstartsrv
    
    nw1-cl-1:~ # kill -9 59545
    

    sapstartsrv 프로세스는 항상 Pacemaker 리소스 에이전트에 의해 다시 시작되어야 합니다. 테스트 후 리소스 상태:

    stonith-sbd     (stonith:external/sbd): Started nw1-cl-1
     Resource Group: g-NW1_ASCS
         fs_NW1_ASCS        (ocf::heartbeat:Filesystem):    Started nw1-cl-1
         nc_NW1_ASCS        (ocf::heartbeat:azure-lb):      Started nw1-cl-1
         vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started nw1-cl-1
         rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started nw1-cl-1
     Resource Group: g-NW1_ERS
         fs_NW1_ERS (ocf::heartbeat:Filesystem):    Started nw1-cl-0
         nc_NW1_ERS (ocf::heartbeat:azure-lb):      Started nw1-cl-0
         vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started nw1-cl-0
         rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started nw1-cl-0
    

다음 단계