본문 바로가기
서버 운영/Pacemaker

리눅스 Pacemaker 리소스 생성 및 설정

by Infralabs 2024. 4. 9.
반응형

2024.03.19 - [서버 운영/Pacemaker] - 리눅스 pacemaker 설치 및 클러스터 구성하기(RHEL 8.X)

 

앞서 Pacemaker를 설치하는 과정을 설명하였습니다. 다음 단계로 대표적인 리소스(VG, 파일시스템, VIP 등)를 생성하고 설정하는 방법을 설명하고자 합니다.

설치 환경
- OS : Rocky Linux 8.8
- 가상화 플랫폼 : VMware Vsphere Horizon 8
- VMware 가상 서버 2대
 

리소스 생성

1. VG 리소스 생성 (Volume Group)

1) /etc/lvm/lvm.conf 수정

$ vi /etc/lvm/lvm.conf
# system_id_source = "uname" 주석 해제
system_id_source = "uname"

2) vg systemid 변경

현재 공유 디스크가 1번 서버에 붙어있으므로, 아래 명령어는 1번 서버에서 수행합니다.

$ vgchage --systemid $(uname -n) vgdata

 

3) VG 리소스 생성

$ pcs resource create test_vg LVM-activate vgname=vgdata vg_access_mode=system_id --group testgroup
 
 

2. VIP 리소스 생성

$ pcs resource create test_vip IPaddr2 ip=10.100.1.3 cidr_netmask=24 --group testgroup
 

3. VIP 통신을 위한 Gateway 리소스 생성

$ pcs resource create default_gw ocf:heartbeat:Route destination="0.0.0.0/0" device="ens33" gateway="10.100.1.254" source="10.100.1.3" --group testgroup
$ pcs constraint order test_vip then default_gw
$ pcs constraint colocation add default_gw with test_vip INFINITY
 

4. LV 리소스 생성 (Logical Volume)

$ pcs resource create lv_data Filesystem device="/dev/vgdata/data" directory="/data" fstype="xfs" --group testgroup
$ pcs resource create lv_mysql Filesystem device="/dev/vgdata/mysql" directory="/var/lib/mysql" fstype="xfs" --group testgroup
 

5. 리소스 모니터링 정책 설정

$ pcs resource update test_vip op monitor interval=10 timeout=20
$ pcs resource update lv_data op monitor interval=20 timeout=60 OCF_CHECK_LEVEL=20
$ pcs resource update lv_mysql op monitor interval=20 timeout=60 OCF_CHECK_LEVEL=20

 

반응형