pacemaker_관리방법

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

pacemaker_관리방법 [2026/01/03 06:59] – 만듦 koovpacemaker_관리방법 [알 수 없는 날짜] (현재) – 바깥 편집 (알 수 없는 날짜) 127.0.0.1
줄 1: 줄 1:
 +====== Pacemaker 관리방법 ======
 +
 +===== 클러스터 상태 표시 =====
 +''pcs status''
 +<WRAP prewrap>
 +<code bash>
 +[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
 +</code>
 +</WRAP>
 +
 +===== 리소스 조회 =====
 +''pcs resource status''
 +''pcs resource config <RESOURCE_NAME>''
 +
 +<WRAP prewrap>
 +<code bash>
 +[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
 +</code>
 +</WRAP>
 +
 +===== 리소스 오류 상태 제거 =====
 +''pcs resource cleanup <RESOURCE_NAME>''
 +
 +<WRAP prewrap>
 +<code bash>
 +[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
 +</code>
 +</WRAP>
 +
 +RESOURCE_NAME을 지정하지 않으면 모든 리소스의 상태와 failcount를 재설정한다.
 +
 +<WRAP prewrap>
 +<code bash>
 +[root@rhcs8-1 ~]# pcs resource cleanup
 +Cleaned up all resources on all nodes
 +</code>
 +</WRAP>
 +
 +===== 클러스터 노드 관리 =====
 +==== 클러스터 서비스 중지 ====
 +''pcs cluster stop [--all | node] [...]''
 +<WRAP prewrap>
 +<code bash>
 +[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
 +</code>
 +</WRAP>
 +
 +==== 클러스터 서비스 활성화 및 비활성화 ====
 +다음 명령을 사용하여 지정된 노드 또는 모든 노드에서 시작 시 실행되도록 클러스터 서비스를 구성합니다.
 +<WRAP prewrap>
 +<code bash>
 +[root@rhcs8-1 ~]# pcs cluster enable [--all | node]
 +
 +[root@rhcs8-1 ~]# pcs cluster disable [--all | node]
 +</code>
 +</WRAP>
 +  * ''%%--all%%'' 옵션을 지정하면 명령은 모든 노드에서 클러스터 서비스를 활성/비활성화 합니다.
 +  * 노드를 지정하지 않으면 로컬 노드에서만 클러스터 서비스가 활성/비활성화 됩니다.
 +
 +===== 클러스터 유지 관리 수행 =====
 +==== 노드를 대기 모드로 전환 ====
 +클러스 노드가 standby 모드이면 노드가 더 이상 리소스를 호스팅 할 수 없습니다. 현재 노드에서 활성화된 모든 리소스는 다른 노드로 이동됩니다.
 +
 +<WRAP prewrap>
 +<code bash>
 +[root@rhcs8-1 ~]# pcs node standby <NODE> | --all
 +
 +[root@rhcs8-1 ~]# pcs node unstandby <NODE> | --all
 +</code>
 +</WRAP>
 +  * ''%%--all%%''을 지정하면 이 명령은 모든노드를 standby/unstandby 모드로 설정합니다.
 +
 +===== 클러스터를 유지 관리 모드로 설정 =====
 +''pcs property set maintenance-mode=true''
 +<WRAP prewrap>
 +<code bash>
 +[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 ]
 +</code>
 +</WRAP>
 +
 +유지 관리 모드에서 클러스터를 제거하려면 다음 명령을 사용하여 ''maintenance-mode'' 클러스터 속성을 ''false'' 로 설정합니다.
 +
 +<WRAP prewrap>
 +<code bash>
 +[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
 +</code>
 +</WRAP>
 +
 +===== 장애 상황시 강제 Fence 수행 및 노드 전환 =====
 +
 +''STONITH(Fence-device)'' __구성이 되어있지 않은 환경에서 장애상황시__ ''Fail-over''가 동작하지 않는 경우 아래 절차에 따라 수동으로 ''fail-over''를 수행 할 수 있습니다.
 +
 +  * 장애가 생긴 노드를 강제로 ''reboot'' 합니다. 이때 정상적으로 ''reboot''이 완료되면 자동으로 ''fail-over''가 동작합니다.
 +  * 만약 장애 노드가 부팅이 불가능하거나 치명적인 문제로 인하여 동작이 불가능한경우 강제로 ''power-off'' 시킵니다.
 +  * 장애 노드가 ''power-off''된 것을 확인 한 후 정상 동작중인 ''slave''서버에서 아래 명령어를 실행합니다. (장애노드가 ''rhcs8-1hb''인 경우)
 +
 +<WRAP prewrap>
 +<code bash>
 +[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)
 +</code>
 +</WRAP>
 +
 +  * 이후 자동으로 slave 노드쪽으로 모든 리소스가 fail-over 동작합니다.
 +  * 서비스 확인합니다.