6.2. Pacemaker 명령


6.2.1. 클러스터 시작 및 중지

모든 노드에서 클러스터를 시작하려면 다음 명령을 실행합니다.

# pcs cluster start -all
Copy to Clipboard Toggle word wrap

재부팅 후 서비스가 활성화된 경우에만 클러스터가 자동으로 시작됩니다. 명령은 클러스터가 시작되었는지 여부와 데몬을 자동으로 시작할 수 있는지 확인하는 데 도움이 됩니다.

# pcs cluster status
Copy to Clipboard Toggle word wrap

다음을 사용하여 클러스터 자동 시작을 활성화할 수 있습니다.

# pcs cluster enable --all
Copy to Clipboard Toggle word wrap

기타 옵션은 다음과 같습니다.

  • 클러스터를 중지합니다.
  • 노드를 대기 상태로 설정합니다.
  • 클러스터를 유지 관리 모드로 설정합니다.

자세한 내용은 pcs cluster help를 확인하십시오.

# pcs cluster stop --all
# pcs cluster help
Copy to Clipboard Toggle word wrap

6.2.2. 클러스터를 유지 관리 모드로 전환

pacemaker 클러스터의 개입을 피하려면 유지보수 모드에 배치하여 클러스터를 "해제"할 수 있습니다.

# pcs property set maintenance-mode=true
Copy to Clipboard Toggle word wrap

유지 관리 모드를 확인하는 쉬운 방법은 리소스가 관리되지 않는지 확인하는 것입니다.

# pcs resource
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged):
    * SAPHanaTopology_RH2_02    (ocf:heartbeat:SAPHanaTopology):         Started clusternode1 (unmanaged)
    * SAPHanaTopology_RH2_02    (ocf:heartbeat:SAPHanaTopology):         Started clusternode2 (unmanaged)
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged):
    * SAPHana_RH2_02    (ocf:heartbeat:SAPHana):         Unpromoted clusternode1 (unmanaged)
    * SAPHana_RH2_02    (ocf:heartbeat:SAPHana):         Promoted clusternode2 (unmanaged)
  * vip_RH2_02_MASTER   (ocf:heartbeat:IPaddr2):         Started clusternode2 (unmanaged)
Copy to Clipboard Toggle word wrap

클러스터가 유지 관리 모드에 있고 리소스 상태 변경 사항을 업데이트하지 않는 동안 클러스터 리소스를 새로 고침합니다.

# pcs resource refresh
Copy to Clipboard Toggle word wrap

이는 아직 올바르지 않은 항목이 있는지 여부를 나타내며 유지 관리 모드에서 제거되는 즉시 클러스터의 수정 조치를 취합니다.

다음을 실행하여 maintenance-mode 를 제거합니다.

# pcs property set maintenance-mode=false
Copy to Clipboard Toggle word wrap

이제 클러스터가 계속 작동합니다. 문제가 발생하면 지금 반응할 것입니다.

6.2.3. 클러스터 상태 확인

다음은 클러스터 상태를 확인하는 몇 가지 방법입니다.

  • 클러스터가 실행 중인지 확인합니다.

    # pcs cluster status
    Copy to Clipboard Toggle word wrap
  • 클러스터 및 모든 리소스를 확인합니다.

    # pcs status
    Copy to Clipboard Toggle word wrap
  • 클러스터, 모든 리소스 및 모든 노드 속성을 확인합니다.

    # pcs status --full
    Copy to Clipboard Toggle word wrap
  • 리소스만 확인합니다.

    # pcs resource status --full
    Copy to Clipboard Toggle word wrap
  • Stonith 기록을 확인하십시오.

    # pcs stonith history
    Copy to Clipboard Toggle word wrap
  • 위치 제한 조건을 확인합니다.

    # pcs constraint location
    Copy to Clipboard Toggle word wrap
참고

펜싱을 구성하고 테스트해야 합니다. 가능한 자동화된 솔루션을 얻으려면 클러스터를 지속적으로 활성화해야 하므로 재부팅 후 클러스터가 자동으로 시작됩니다. 프로덕션 환경에서 재시작을 비활성화하면 예를 들어 충돌 후 수동 개입이 가능합니다. 데몬 상태도 확인하십시오.

예제:

# pcs status --full
Cluster name: cluster1
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-06-22 17:56:01 +02:00)
Cluster Summary:
  * Stack: corosync
  * Current DC: clusternode2 (2) (version 2.1.5-7.el9-a3f44794f94) - partition with quorum
  * Last updated: Thu Jun 22 17:56:01 2023
  * Last change:  Thu Jun 22 17:53:34 2023 by root via crm_attribute on clusternode1
  * 2 nodes configured
  * 6 resource instances configured
Node List:
  * Node clusternode1 (1): online, feature set 3.16.2
  * Node clusternode2 (2): online, feature set 3.16.2
Full List of Resources:
  * h7fence	(stonith:fence_rhevm):	 Started clusternode2
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]:
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode1
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode2
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable):
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Promoted clusternode1
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Unpromoted clusternode2
  * vip_RH2_02_MASTER	(ocf:heartbeat:IPaddr2):	 Started clusternode1
Node Attributes:
  * Node: clusternode1 (1):
    * hana_rh2_clone_state            	: PROMOTED
    * hana_rh2_op_mode                	: logreplay
    * hana_rh2_remoteHost             	: clusternode2
    * hana_rh2_roles                  	: 4:P:master1:master:worker:master
    * hana_rh2_site                   	: DC1
    * hana_rh2_sra                    	: -
    * hana_rh2_srah                   	: -
    * hana_rh2_srmode                 	: syncmem
    * hana_rh2_sync_state             	: PRIM
    * hana_rh2_version                	: 2.00.059.02
    * hana_rh2_vhost                  	: clusternode1
    * lpa_rh2_lpt                     	: 1687449214
    * master-SAPHana_RH2_02           	: 150
  * Node: clusternode2 (2):
    * hana_rh2_clone_state            	: DEMOTED
    * hana_rh2_op_mode                	: logreplay
    * hana_rh2_remoteHost             	: clusternode1
    * hana_rh2_roles                  	: 4:S:master1:master:worker:master
    * hana_rh2_site                   	: DC2
    * hana_rh2_sra                    	: -
    * hana_rh2_srah                   	: -
    * hana_rh2_srmode                 	: syncmem
    * hana_rh2_sync_state             	: SOK
    * hana_rh2_version                	: 2.00.059.02
    * hana_rh2_vhost                  	: clusternode2
    * lpa_rh2_lpt                     	: 30
    * master-SAPHana_RH2_02           	: 100
Migration Summary:
Tickets:
PCSD Status:
  clusternode1: Online
  clusternode2: Online
Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
Copy to Clipboard Toggle word wrap

6.2.4. 리소스 상태 확인

pcs 리소스 를 사용하여 모든 리소스의 상태를 확인합니다. 그러면 리소스 목록과 현재 상태가 출력됩니다.

예제:

# pcs resource
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]:
    * Started: [ clusternode1 clusternode2 ]
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable):
    * Promoted: [ clusternode1 ]
    * Unpromoted: [ clusternode2 ]
  * vip_RH2_02_MASTER	(ocf:heartbeat:IPaddr2):	 Started clusternode1
Copy to Clipboard Toggle word wrap

6.2.5. 리소스 구성 확인

다음은 현재 리소스 구성을 표시합니다.

# pcs resource config
Resource: vip_RH2_02_MASTER (class=ocf provider=heartbeat type=IPaddr2)
  Attributes: vip_RH2_02_MASTER-instance_attributes
    ip=192.168.5.136
  Operations:
    monitor: vip_RH2_02_MASTER-monitor-interval-10s
      interval=10s
      timeout=20s
    start: vip_RH2_02_MASTER-start-interval-0s
      interval=0s
      timeout=20s
    stop: vip_RH2_02_MASTER-stop-interval-0s
      interval=0s
      timeout=20s
Clone: SAPHanaTopology_RH2_02-clone
  Meta Attributes: SAPHanaTopology_RH2_02-clone-meta_attributes
    clone-max=2
    clone-node-max=1
    interleave=true
  Resource: SAPHanaTopology_RH2_02 (class=ocf provider=heartbeat type=SAPHanaTopology)
    Attributes: SAPHanaTopology_RH2_02-instance_attributes
      InstanceNumber=02
      SID=RH2
    Operations:
      methods: SAPHanaTopology_RH2_02-methods-interval-0s
        interval=0s
        timeout=5
      monitor: SAPHanaTopology_RH2_02-monitor-interval-10
        interval=10
        timeout=600
      reload: SAPHanaTopology_RH2_02-reload-interval-0s
        interval=0s
        timeout=5
      start: SAPHanaTopology_RH2_02-start-interval-0s
        interval=0s
        timeout=600
      stop: SAPHanaTopology_RH2_02-stop-interval-0s
        interval=0s
        timeout=600
Clone: SAPHana_RH2_02-clone
  Meta Attributes: SAPHana_RH2_02-clone-meta_attributes
    clone-max=2
    clone-node-max=1
    interleave=true
    notify=true
    promotable=true
  Resource: SAPHana_RH2_02 (class=ocf provider=heartbeat type=SAPHana)
    Attributes: SAPHana_RH2_02-instance_attributes
      AUTOMATED_REGISTER=true
      DUPLICATE_PRIMARY_TIMEOUT=300
      HANA_CALL_TIMEOUT=10
      InstanceNumber=02
      PREFER_SITE_TAKEOVER=true
      SID=RH2
    Operations:
      demote: SAPHana_RH2_02-demote-interval-0s
        interval=0s
        timeout=3600
      methods: SAPHana_RH2_02-methods-interval-0s
        interval=0s
        timeout=5
      monitor: SAPHana_RH2_02-monitor-interval-251
        interval=251
        timeout=700
        role=Unpromoted
      monitor: SAPHana_RH2_02-monitor-interval-249
        interval=249
        timeout=700
        role=Promoted
      promote: SAPHana_RH2_02-promote-interval-0s
        interval=0s
        timeout=3600
      reload: SAPHana_RH2_02-reload-interval-0s
        interval=0s
        timeout=5
      start: SAPHana_RH2_02-start-interval-0s
        interval=0s
        timeout=3200
      stop: SAPHana_RH2_02-stop-interval-0s
        interval=0s
        timeout=3100
Copy to Clipboard Toggle word wrap

그러면 설치 및 구성된 리소스 에이전트를 구성하는 데 사용되는 모든 매개 변수가 나열됩니다.

6.2.6. saphana 리소스 옵션 AUTOMATED_REGISTER=true

SAPHana 리소스에서 이 옵션을 사용하는 경우 pacemaker는 보조 데이터베이스를 자동으로 다시 등록합니다.

첫 번째 테스트에 이 옵션을 사용하는 것이 좋습니다. AUTOMATED_REGISTER=false 를 사용하는 경우 관리자는 보조 노드를 수동으로 다시 등록해야 합니다.

6.2.7. 리소스 처리

리소스 관리를 위한 몇 가지 옵션이 있습니다. 자세한 내용은 사용 가능한 도움말을 확인하십시오.

# pcs resource help
Copy to Clipboard Toggle word wrap

사용된 리소스 에이전트를 나열합니다.

# pcs resource config | grep "type=" | awk -F"type=" '{ print $2 }' | sed -e "s/)//g"
Copy to Clipboard Toggle word wrap

출력 예:

IPaddr2
SAPHanaTopology
SAPHana
Copy to Clipboard Toggle word wrap

특정 리소스 에이전트 설명 및 구성 매개변수를 표시합니다.

# pcs resource describe <resource agent>
Copy to Clipboard Toggle word wrap

예(출력 없음):

# pcs resource describe IPaddr2
Copy to Clipboard Toggle word wrap

리소스 에이전트 IPaddr2 의 예(출력 포함):

Assumed agent name 'ocf:heartbeat:IPaddr2' (deduced from 'IPaddr2')
ocf:heartbeat:IPaddr2 - Manages virtual IPv4 and IPv6 addresses (Linux specific version)

This Linux-specific resource manages IP alias IP addresses. It can add an IP alias, or remove one. In
addition, it can implement Cluster Alias IP functionality if invoked as a clone resource.  If used as a
clone, "shared address with a trivial, stateless (autonomous) load-balancing/mutual exclusion on
ingress" mode gets applied (as opposed to "assume resource uniqueness" mode otherwise). For that, Linux
firewall (kernel and userspace) is assumed, and since recent distributions are ambivalent in plain
"iptables" command to particular back-end resolution, "iptables-legacy" (when present) gets prioritized
so as to avoid incompatibilities (note that respective ipt_CLUSTERIP firewall extension in use here is,
at the same time, marked deprecated, yet said "legacy" layer can make it workable, literally, to this
day) with "netfilter" one (as in "iptables-nft"). In that case, you should explicitly set clone-node-max
>= 2, and/or clone-max < number of nodes. In case of node failure, clone instances need to be re-
allocated on surviving nodes. This would not be possible if there is already an instance on those nodes,
and clone-node-max=1 (which is the default).  When the specified IP address gets assigned to a
respective interface, the resource agent sends unsolicited ARP (Address Resolution Protocol, IPv4) or NA
(Neighbor Advertisement, IPv6) packets to inform neighboring machines about the change. This
functionality is controlled for both IPv4 and IPv6 by shared 'arp_*' parameters.

Resource options:
  ip (required) (unique): The IPv4 (dotted quad notation) or IPv6 address (colon hexadecimal notation)
      example IPv4 "192.168.1.1". example IPv6 "2001:db8:DC28:0:0:FC57:D4C8:1FFF".
  nic: The base network interface on which the IP address will be brought online.  If left empty, the
      script will try and determine this from the routing table.  Do NOT specify an alias interface in
      the form eth0:1 or anything here; rather, specify the base interface only. If you want a label,
      see the iflabel parameter.  Prerequisite:  There must be at least one static IP address, which is
      not managed by the cluster, assigned to the network interface. If you can not assign any static IP
      address on the interface, modify this kernel parameter:  sysctl -w
      net.ipv4.conf.all.promote_secondaries=1 # (or per device)
  cidr_netmask: The netmask for the interface in CIDR format (e.g., 24 and not 255.255.255.0)  If
      unspecified, the script will also try to determine this from the routing table.
  broadcast: Broadcast address associated with the IP. It is possible to use the special symbols '+' and
      '-' instead of the broadcast address. In this case, the broadcast address is derived by
      setting/resetting the host bits of the interface prefix.
  iflabel: You can specify an additional label for your IP address here. This label is appended to your
      interface name.  The kernel allows alphanumeric labels up to a maximum length of 15 characters
      including the interface name and colon (e.g. eth0:foobar1234)  A label can be specified in nic
      parameter but it is deprecated. If a label is specified in nic name, this parameter has no effect.
  lvs_support: Enable support for LVS Direct Routing configurations. In case a IP address is stopped,
      only move it to the loopback device to allow the local node to continue to service requests, but
      no longer advertise it on the network.  Notes for IPv6: It is not necessary to enable this option
      on IPv6. Instead, enable 'lvs_ipv6_addrlabel' option for LVS-DR usage on IPv6.
  lvs_ipv6_addrlabel: Enable adding IPv6 address label so IPv6 traffic originating from the address's
      interface does not use this address as the source. This is necessary for LVS-DR health checks to
      realservers to work. Without it, the most recently added IPv6 address (probably the address added
      by IPaddr2) will be used as the source address for IPv6 traffic from that interface and since that
      address exists on loopback on the realservers, the realserver response to pings/connections will
      never leave its loopback. See RFC3484 for the detail of the source address selection.  See also
      'lvs_ipv6_addrlabel_value' parameter.
  lvs_ipv6_addrlabel_value: Specify IPv6 address label value used when 'lvs_ipv6_addrlabel' is enabled.
      The value should be an unused label in the policy table which is shown by 'ip addrlabel list'
      command. You would rarely need to change this parameter.
  mac: Set the interface MAC address explicitly. Currently only used in case of the Cluster IP Alias.
      Leave empty to chose automatically.
  clusterip_hash: Specify the hashing algorithm used for the Cluster IP functionality.
  unique_clone_address: If true, add the clone ID to the supplied value of IP to create a unique address
      to manage
  arp_interval: Specify the interval between unsolicited ARP (IPv4) or NA (IPv6) packets in
      milliseconds.  This parameter is deprecated and used for the backward compatibility only. It is
      effective only for the send_arp binary which is built with libnet, and send_ua for IPv6. It has no
      effect for other arp_sender.
  arp_count: Number of unsolicited ARP (IPv4) or NA (IPv6) packets to send at resource initialization.
  arp_count_refresh: For IPv4, number of unsolicited ARP packets to send during resource monitoring.
      Doing so helps mitigate issues of stuck ARP caches resulting from split-brain situations.
  arp_bg: Whether or not to send the ARP (IPv4) or NA (IPv6) packets in the background. The default is
      true for IPv4 and false for IPv6.
  arp_sender: For IPv4, the program to send ARP packets with on start. Available options are:  -
      send_arp: default  - ipoibarping: default for infiniband interfaces if ipoibarping is available  -
      iputils_arping: use arping in iputils package  - libnet_arping: use another variant of arping
      based on libnet
  send_arp_opts: For IPv4, extra options to pass to the arp_sender program. Available options are vary
      depending on which arp_sender is used.  A typical use case is specifying '-A' for iputils_arping
      to use ARP REPLY instead of ARP REQUEST as Gratuitous ARPs.
  flush_routes: Flush the routing table on stop. This is for applications which use the cluster IP
      address and which run on the same physical host that the IP address lives on. The Linux kernel may
      force that application to take a shortcut to the local loopback interface, instead of the
      interface the address is really bound to. Under those circumstances, an application may, somewhat
      unexpectedly, continue to use connections for some time even after the IP address is deconfigured.
      Set this parameter in order to immediately disable said shortcut when the IP address goes away.
  run_arping: For IPv4, whether or not to run arping for collision detection check.
  nodad: For IPv6, do not perform Duplicate Address Detection when adding the address.
  noprefixroute: Use noprefixroute flag (see 'man ip-address').
  preferred_lft: For IPv6, set the preferred lifetime of the IP address. This can be used to ensure that
      the created IP address will not be used as a source address for routing. Expects a value as
      specified in section 5.5.4 of RFC 4862.
  network_namespace: Specifies the network namespace to operate within. The namespace must already
      exist, and the interface to be used must be within the namespace.

Default operations:
  start:
    interval=0s
    timeout=20s
  stop:
    interval=0s
    timeout=20s
  monitor:
    interval=10s
    timeout=20s
Copy to Clipboard Toggle word wrap

클러스터가 중지되면 모든 리소스도 중지됩니다. 클러스터가 유지 관리 모드에 배치되면 모든 리소스가 계속 실행되고 있지만 모니터링 또는 관리되지 않습니다.

6.2.8. 유지 관리 모드를 위한 클러스터 속성 처리

정의된 모든 속성을 나열합니다.

[root@clusternode1] pcs property
Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: cluster1
 concurrent-fencing: true
 dc-version: 2.1.5-7.el9-a3f44794f94
 hana_rh2_site_srHook_DC1: PRIM
 hana_rh2_site_srHook_DC2: SFAIL
 have-watchdog: false
 last-lrm-refresh: 1688548036
 maintenance-mode: true
 priority-fencing-delay: 10s
 stonith-enabled: true
 stonith-timeout: 900
Copy to Clipboard Toggle word wrap

데이터베이스를 재구성하려면 구성이 완료될 때까지 변경 사항을 무시하도록 클러스터에 지시해야 합니다. 다음을 사용하여 클러스터를 유지보수 모드에 배치할 수 있습니다.

# pcs property set maintenance-mode=true
Copy to Clipboard Toggle word wrap

maintenance-mode 를 확인합니다.

# pcs resource
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged):
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode1 (unmanaged)
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode2 (unmanaged)
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged):
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Promoted clusternode1 (unmanaged)
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Unpromoted clusternode2 (unmanaged)
  * vip_RH2_02_MASTER	(ocf:heartbeat:IPaddr2):	 Started clusternode1 (unmanaged)
Copy to Clipboard Toggle word wrap

모든 리소스가 "관리되지 않음"인지 확인합니다.

[root@clusternode1]# pcs status
Cluster name: cluster1
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-06-27 16:02:15 +02:00)
Cluster Summary:
  * Stack: corosync
  * Current DC: clusternode2 (version 2.1.5-7.el9-a3f44794f94) - partition with quorum
  * Last updated: Tue Jun 27 16:02:16 2023
  * Last change:  Tue Jun 27 16:02:14 2023 by root via cibadmin on clusternode1
  * 2 nodes configured
  * 6 resource instances configured

              *** Resource management is DISABLED ***
  The cluster will not attempt to start, stop or recover services

Node List:
  * Online: [ clusternode1 clusternode2 ]

Full List of Resources:
  * h7fence	(stonith:fence_rhevm):	 Started clusternode2 (unmanaged)
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged):
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode1 (unmanaged)
    * SAPHanaTopology_RH2_02	(ocf:heartbeat:SAPHanaTopology):	 Started clusternode2 (unmanaged)
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged):
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Promoted clusternode1 (unmanaged)
    * SAPHana_RH2_02	(ocf:heartbeat:SAPHana):	 Unpromoted clusternode2 (unmanaged)
  * vip_RH2_02_MASTER	(ocf:heartbeat:IPaddr2):	 Started clusternode1 (unmanaged)

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
Copy to Clipboard Toggle word wrap

maintenance-mode 를 설정 해제하면 리소스가 다시 Managed로 전환됩니다.

# pcs property set maintenance-mode=false
Copy to Clipboard Toggle word wrap

6.2.9. 이동을 사용하여 SAPHana 리소스 장애 조치

SAP HANA 데이터베이스 장애 조치(failover) 방법의 간단한 예는 pcs resource move 명령을 사용하는 것입니다. 다음과 같이 복제 리소스 이름을 사용하고 리소스를 이동해야 합니다.

# pcs resource move <SAPHana-clone-resource>
Copy to Clipboard Toggle word wrap

이 예제에서 복제 리소스는 SAPHana_RH2_02-clone:입니다.

[root@clusternode1]# pcs resource
  * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]:
    * Started: [ clusternode1 clusternode2 ]
  * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable):
    * Promoted: [ clusternode1 ]
    * Unpromoted: [ clusternode2 ]
  * vip_RH2_02_MASTER	(ocf:heartbeat:IPaddr2):	 Started clusternode1
Copy to Clipboard Toggle word wrap

리소스를 이동합니다.

# pcs resource move SAPHana_RH2_02-clone
Location constraint to move resource 'SAPHana_RH2_02-clone' has been created
Waiting for the cluster to apply configuration changes...
Location constraint created to move resource 'SAPHana_RH2_02-clone' has been removed
Waiting for the cluster to apply configuration changes...
resource 'SAPHana_RH2_02-clone' is promoted on node 'clusternode2'; unpromoted on node 'clusternode1'
Copy to Clipboard Toggle word wrap

나머지 제약 조건이 있는지 확인합니다.

# pcs constraint location
Copy to Clipboard Toggle word wrap

리소스를 지워 장애 조치 중에 생성된 위치 제약 조건을 제거할 수 있습니다. 예제:

[root@clusternode1]# pcs resource clear SAPHana_RH2_02-clone
Copy to Clipboard Toggle word wrap

"Migration Summary"에 남아 있는 경고 또는 항목이 있는지 확인합니다.

# pcs status --full
Copy to Clipboard Toggle word wrap

stonith 기록을 확인하십시오.

# pcs stonith history
Copy to Clipboard Toggle word wrap

필요한 경우 stonith 기록을 지웁니다.

# pcs stonith history cleanup
Copy to Clipboard Toggle word wrap

2.1.5 이전의 pacemaker 버전을 사용하는 경우 pcs resource move를 실행할 때 제약 조건을 관리하고 나머지 제약 조건을 확인할 수 있습니다.

6.2.10. 페일오버 및 동기화 상태 모니터링

모든 pacemaker 작업은 클러스터 노드의 /var/log/messages 파일에 기록됩니다. 다른 많은 메시지가 있으므로 SAP 리소스 에이전트와 관련된 메시지를 읽기가 어려울 수 있습니다. SAP 리소스 에이전트와 관련된 메시지만 필터링하는 명령 별칭을 구성할 수 있습니다.

별칭 tmsl 예:

# alias tmsl='tail -1000f /var/log/messages | egrep -s "Setting master-rsc_SAPHana_$SAPSYSTEMNAME_HDB${TINSTANCE}|sr_register|WAITING4LPA|PROMOTED|DEMOTED|UNDEFINED|master_walk|SWAIT|WaitforStopped|FAILED|LPT"'
Copy to Clipboard Toggle word wrap

tsml 출력 예:

[root@clusternode1]# tmsl
Jun 22 13:59:54 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: secondary with sync status SOK ==> possible takeover node
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK)
Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK)
Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: secondary with sync status SOK ==> possible takeover node
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK)
Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK)
Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: secondary with sync status SOK ==> possible takeover node
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK)
Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK)
Jun 22 14:12:35 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:12:35 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:12:36 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: secondary with sync status SOK ==> possible takeover node
Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK)
Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK)
Jun 22 14:14:01 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: PROMOTED -> DEMOTED
Jun 22 14:14:02 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: DEMOTED -> UNDEFINED
Jun 22 14:14:19 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode1]: DEMOTED -> PROMOTED
Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK
Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: Finally get_SRHOOK()=SOK
Jun 22 14:15:14 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT
Jun 22 14:15:22 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode1]: SOK -> PRIM
Jun 22 14:15:23 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: PRIM -> SOK
Jun 22 14:15:23 clusternode1 SAPHana(SAPHana_RH2_02)[934810]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:15:25 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: UNDEFINED -> DEMOTED
Jun 22 14:15:32 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: SOK -> SFAIL
Jun 22 14:19:36 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: SFAIL -> SOK
Jun 22 14:19:36 clusternode1 SAPHana(SAPHana_RH2_02)[942693]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:23:49 clusternode1 SAPHana(SAPHana_RH2_02)[950623]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:28:02 clusternode1 SAPHana(SAPHana_RH2_02)[958633]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:32:15 clusternode1 SAPHana(SAPHana_RH2_02)[966683]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:36:27 clusternode1 SAPHana(SAPHana_RH2_02)[974736]: INFO: ACT site=DC1, setting SOK for secondary (1)
Jun 22 14:40:40 clusternode1 SAPHana(SAPHana_RH2_02)[982934]: INFO: ACT site=DC1, setting SOK for secondary (1)
Copy to Clipboard Toggle word wrap

필터를 사용하면 발생하는 상태 변경 사항을 더 쉽게 파악할 수 있습니다. 세부 정보가 누락된 경우 전체 메시지 파일을 열어 모든 정보를 읽을 수 있습니다.

장애 조치(failover) 후 리소스를 지울 수 있습니다. 또한 남은 위치 제약 조건이 없는지 확인하십시오.

6.2.11. 클러스터 일관성 확인

설치 중에 구성이 마지막으로 완료되기 전에 리소스가 시작되는 경우가 있습니다. 이로 인해 CIB(Cluster Information Base)에 항목이 발생하여 잘못된 동작이 발생할 수 있습니다. 이는 구성을 완료한 후 쉽게 확인하고 수동으로 수정할 수 있습니다.

SAPHana 리소스를 시작하면 누락된 항목이 다시 생성됩니다. 잘못된 항목은 pcs 명령으로 처리할 수 없으며 수동으로 제거해야 합니다.

CIB 항목을 확인합니다.

# cibadmin --query
Copy to Clipboard Toggle word wrap

DC3 및 SFAIL은 클러스터 멤버가 DC1 및 DC2인 경우 및 노드 간 동기화 상태가 SOK로 보고되는 경우 클러스터 정보 베이스에 존재하지 않아야 하는 항목입니다.

해당 항목을 확인하는 예:

# cibadmin --query |grep '"DC3"'
# cibadmin --query |grep '"SFAIL"'
Copy to Clipboard Toggle word wrap

root 사용자로 클러스터의 모든 노드에서 명령을 실행할 수 있습니다. 일반적으로 명령 출력이 비어 있습니다. 구성에 오류가 계속 있는 경우 출력은 다음과 같습니다.

        <nvpair id="SAPHanaSR-hana_rh1_glob_sec" name="hana_rh1_glob_sec" value="DC3"/>
Copy to Clipboard Toggle word wrap

이러한 항목은 다음 명령을 사용하여 제거할 수 있습니다.

# cibadmin --delete --xml-text '<...>'
Copy to Clipboard Toggle word wrap

위 예제의 항목을 제거하려면 다음을 입력해야 합니다. 출력에는 큰따옴표가 포함되어 있으므로 텍스트를 작은따옴표로 포함해야 합니다.

# cibadmin --delete --xml-text '        <nvpair id="SAPHanaSR-hana_rh1_glob_sec" name="hana_rh1_glob_sec" value="DC3"/>'
Copy to Clipboard Toggle word wrap

제거된 CIB 항목이 없는지 확인합니다. 반환된 출력은 비어 있어야 합니다.

# cibadmin --query |grep 'DC3"'
Copy to Clipboard Toggle word wrap

6.2.12. 클러스터 정리

장애 조치 테스트 중에 제약 조건 뒤에 남아 있고 다른 하나는 이전 테스트에서 남아 있을 수 있습니다.During the failover tests there might be left behind constraints and other remains from previous tests. 다음 테스트를 시작하기 전에 클러스터를 지워야 합니다.

클러스터 상태에 실패 이벤트가 있는지 확인합니다.

# pcs status --full
Copy to Clipboard Toggle word wrap

"Migration Summary"에 클러스터 경고 또는 항목이 표시되면 리소스를 지우고 정리해야 합니다.

# pcs resource clear SAPHana_RH2_02-clone
# pcs resource cleanup SAPHana_RH2_02-clone
Copy to Clipboard Toggle word wrap

출력:

Cleaned up SAPHana_RH2_02:0 on clusternode1
Cleaned up SAPHana_RH2_02:1 on clusternode2
Copy to Clipboard Toggle word wrap

예를 들어 이전 장애 조치의 경우 원하지 않는 위치 제약 조건이 있는지 확인합니다.

# pcs constraint location
Copy to Clipboard Toggle word wrap

기존 제약 조건을 자세히 확인합니다.

# pcs constraint --full
Copy to Clipboard Toggle word wrap

리소스 이동 후 위치 제한 조건의 예:

      Node: hana08 (score:-INFINITY) (role:Started) (id:cli-ban-SAPHana_RH2_02-clone-on-hana08)
Copy to Clipboard Toggle word wrap

이 위치 제약 조건을 지웁니다.

# pcs resource clear SAPHana_RH2_02-clone
Copy to Clipboard Toggle word wrap

제약 조건이 제약 조건 목록에서 사라졌는지 확인합니다. 유지되는 경우 제약 조건 ID를 사용하여 명시적으로 삭제합니다.

# pcs constraint delete cli-ban-SAPHana_RH2_02-clone-on-hana08
Copy to Clipboard Toggle word wrap

펜싱을 사용하여 여러 테스트를 실행하는 경우 stonith 기록을 지울 수도 있습니다.

# pcs stonith history cleanup
Copy to Clipboard Toggle word wrap

모든 pcs 명령은 root 사용자로 실행됩니다. 또한 Discover leftovers 를 확인하시기 바랍니다.

6.2.13. 기타 클러스터 명령

다양한 클러스터 명령 예

# pcs status --full
# crm_mon -1Arf # Provides an overview
# pcs resource # Lists all resources and shows if they are running
# pcs constraint --full # Lists all constraint ids which should be removed
# pcs cluster start --all # This will start the cluster on all nodes
# pcs cluster stop --all # This will stop the cluster on all nodes
# pcs node attribute # Lists node attributes
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat