Pacemaker 관리방법

pcs status

[root@rhcs8-1 ~]# pcs status
Cluster name: CL1
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: rhcs8-2hb (version 2.1.7-5.3.el8_10-0f7f88312) - partition with quorum
  * Last updated: Tue Nov 11 12:49:49 2025 on rhcs8-1hb
  * Last change:  Mon Nov 10 09:46:18 2025 by root via root on rhcs8-2hb
  * 2 nodes configured
  * 7 resource instances configured

Node List:
  * Online: [ rhcs8-1hb rhcs8-2hb ]

Full List of Resources:
  * Resource Group: dbgroup:
    * my_lvm	(ocf::heartbeat:LVM-activate):	 Started rhcs8-1hb
    * clusterFS	(ocf::heartbeat:Filesystem):	 Started rhcs8-1hb
    * VIP	(ocf::heartbeat:IPaddr2):	 Started rhcs8-1hb
    * myoracle	(ocf::heartbeat:oracle):	 Started rhcs8-1hb
    * mylistener	(ocf::heartbeat:oralsnr):	 Started rhcs8-1hb
  * fence-node1	(stonith:fence_ipmilan):	 Started rhcs8-2hb
  * fence-node2	(stonith:fence_ipmilan):	 Started rhcs8-2hb

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

pcs resource status
pcs resource config <RESOURCE_NAME>

[root@rhcs8-1 ~]# pcs resource status
  * Resource Group: dbgroup:
    * my_lvm	(ocf::heartbeat:LVM-activate):	 Started rhcs8-1hb
    * clusterFS	(ocf::heartbeat:Filesystem):	 Started rhcs8-1hb
    * VIP	(ocf::heartbeat:IPaddr2):	 Started rhcs8-1hb
    * myoracle	(ocf::heartbeat:oracle):	 Started rhcs8-1hb
    * mylistener	(ocf::heartbeat:oralsnr):	 Started rhcs8-1hb

[root@rhcs8-1 ~]# pcs resource config VIP
Resource: VIP (class=ocf provider=heartbeat type=IPaddr2)
  Attributes: VIP-instance_attributes
    ip=10.33.0.80
  Operations:
    monitor: VIP-monitor-interval-10s
      interval=10s
      timeout=20s
    start: VIP-start-interval-0s
      interval=0s
      timeout=20s
    stop: VIP-stop-interval-0s
      interval=0s
      timeout=20s

pcs resource cleanup <RESOURCE_NAME>

[root@rhcs8-1 ~]# pcs resource cleanup VIP
Cleaned up my_lvm on rhcs8-2hb
Cleaned up my_lvm on rhcs8-1hb
Cleaned up clusterFS on rhcs8-2hb
Cleaned up clusterFS on rhcs8-1hb
Cleaned up VIP on rhcs8-2hb
Cleaned up VIP on rhcs8-1hb
Cleaned up myoracle on rhcs8-2hb
Cleaned up myoracle on rhcs8-1hb
Cleaned up mylistener on rhcs8-2hb
Cleaned up mylistener on rhcs8-1hb

RESOURCE_NAME을 지정하지 않으면 모든 리소스의 상태와 failcount를 재설정한다.

[root@rhcs8-1 ~]# pcs resource cleanup
Cleaned up all resources on all nodes

pcs cluster stop [–all | node] […]

[root@rhcs8-1 ~]# pcs cluster stop --all
rhcs8-1hb: Stopping Cluster (pacemaker)...
rhcs8-2hb: Stopping Cluster (pacemaker)...
rhcs8-2hb: Stopping Cluster (corosync)...
rhcs8-1hb: Stopping Cluster (corosync)...
<code>
</WRAP>

''kill -9'' 명령을 수행하는 다음 명령을 사용하여 로컬 노드에서 클러스터 서비스를 강제로 중지할 수 있습니다.
<WRAP prewrap>
<code bash>
[root@rhcs8-1 ~]# pcs cluster kill

다음 명령을 사용하여 지정된 노드 또는 모든 노드에서 시작 시 실행되도록 클러스터 서비스를 구성합니다.

[root@rhcs8-1 ~]# pcs cluster enable [--all | node]

[root@rhcs8-1 ~]# pcs cluster disable [--all | node]
  • --all 옵션을 지정하면 명령은 모든 노드에서 클러스터 서비스를 활성/비활성화 합니다.
  • 노드를 지정하지 않으면 로컬 노드에서만 클러스터 서비스가 활성/비활성화 됩니다.

클러스 노드가 standby 모드이면 노드가 더 이상 리소스를 호스팅 할 수 없습니다. 현재 노드에서 활성화된 모든 리소스는 다른 노드로 이동됩니다.

[root@rhcs8-1 ~]# pcs node standby <NODE> | --all

[root@rhcs8-1 ~]# pcs node unstandby <NODE> | --all
  • --all을 지정하면 이 명령은 모든노드를 standby/unstandby 모드로 설정합니다.

pcs property set maintenance-mode=true

[root@rhcs8-1 ~]# pcs property set maintenance-mode=true
[root@rhcs8-1 ~]# pcs status
Cluster name: CL1
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: rhcs8-2hb (version 2.1.7-5.3.el8_10-0f7f88312) - partition with quorum
  * Last updated: Tue Nov 11 13:20:33 2025 on rhcs8-1hb
  * Last change:  Tue Nov 11 13:20:30 2025 by root via root on rhcs8-1hb
  * 2 nodes configured
  * 7 resource instances configured

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

Node List:
  * Online: [ rhcs8-1hb rhcs8-2hb ]

유지 관리 모드에서 클러스터를 제거하려면 다음 명령을 사용하여 maintenance-mode 클러스터 속성을 false 로 설정합니다.

[root@rhcs8-1 ~]# pcs property set maintenance-mode=false
[root@rhcs8-1 ~]# pcs status
Cluster name: CL1
Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC: rhcs8-2hb (version 2.1.7-5.3.el8_10-0f7f88312) - partition with quorum
  * Last updated: Tue Nov 11 13:22:21 2025 on rhcs8-1hb
  * Last change:  Tue Nov 11 13:22:19 2025 by root via root on rhcs8-1hb
  * 2 nodes configured
  * 7 resource instances configured

Node List:
  * Online: [ rhcs8-1hb rhcs8-2hb ]

Full List of Resources:
  * Resource Group: dbgroup:
    * my_lvm	(ocf::heartbeat:LVM-activate):	 Started rhcs8-2hb
    * clusterFS	(ocf::heartbeat:Filesystem):	 Started rhcs8-2hb
    * VIP	(ocf::heartbeat:IPaddr2):	 Started rhcs8-2hb
    * myoracle	(ocf::heartbeat:oracle):	 Started rhcs8-2hb
    * mylistener	(ocf::heartbeat:oralsnr):	 Started rhcs8-2hb
  * fence-node1	(stonith:fence_ipmilan):	 Started rhcs8-1hb
  * fence-node2	(stonith:fence_ipmilan):	 Started rhcs8-1hb

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

STONITH(Fence-device) 구성이 되어있지 않은 환경에서 장애상황시 Fail-over가 동작하지 않는 경우 아래 절차에 따라 수동으로 fail-over를 수행 할 수 있습니다.

  • 장애가 생긴 노드를 강제로 reboot 합니다. 이때 정상적으로 reboot이 완료되면 자동으로 fail-over가 동작합니다.
  • 만약 장애 노드가 부팅이 불가능하거나 치명적인 문제로 인하여 동작이 불가능한경우 강제로 power-off 시킵니다.
  • 장애 노드가 power-off된 것을 확인 한 후 정상 동작중인 slave서버에서 아래 명령어를 실행합니다. (장애노드가 rhcs8-1hb인 경우)
[root@rhcs8-2 ~]# pcs stonith confirm rhcs8-1hb
WARNING: If node rhcs8-1hb is not powered off or it does have access to shared resources, data corruption and/or cluster failure may occur. Are you sure you want to continue? [y/N] y
Node: rhcs8-1hb confirmed fenced

Cluster Summary:
  * Stack: corosync (Pacemaker is running)
  * Current DC:	rhcs8-2hb (version 2.1.7-5.3.el8_10-0f7f88312) - partition with quorum
  * Last updated: Fri Nov  7 22:54:50 2025 on rhcs8-2hb
  * Last change:  Fri Nov  7 22:39:18 2025 by root via root on rhcs8-2hb
  * 2 nodes configured
  * 7 resource instances configured (2 DISABLED)
  • 이후 자동으로 slave 노드쪽으로 모든 리소스가 fail-over 동작합니다.
  • 서비스 확인합니다.
  • pacemaker_관리방법.txt
  • 마지막으로 수정됨: 2025/12/24 04:09
  • 저자 koov