Pacemaker

망나니엔지니어·2024년 3월 29일

Openstack 설치

목록 보기
3/10

1. Middleware 설치

Pacemaker

Pacemaker란?

고가용성 클러스터 관리 소프트웨어이며, 여러 서버 또는 노드들을 모아 하나의 클러스터로 관리할 수 있다. 클러스터 리소스 매니저(CRM)로, 클러스터 내의 리소스(서비스, 가상 IP, 파일 시스템 마운트 등)를 모니터링하고 관리한다.
Pacemaker는 Corosync 또는 Heartbeat와 같은 메시지 레이어와 함께 사용되는데, 이들은 클러스터 내 노드 간의 통신 및 멤버십 관리를 담당한다. Corosync는 특히 노드 간의 Heartbeat 및 멤버십 정보를 관리하며, 이를 기반으로 Pacemaker는 클러스터의 상태를 파악하고 필요한 조치를 취한다.

Pacemaker 설치

  • Pacemaker는 Corosync와 함께 사용하며, Pacemaker CLI 관리 도구인 PCS도 함께 설치한다.
[모든 노드에서 진행]
apt install pacemaker corosync pcs

Daemon 활성화

[모든 노드에서 진행]
systemctl enable pcsd pacemaker corosync

Cluster 계정 설정

  • 해당 계정을 통해 인증을 한다
[모든 노드에서 진행]
passwd hacluster
New password:
Retype new password:

Cluster Host 인증 및 Cluster 생성

[Con01에서 진행]
pcs cluster destroy
> Cluster 초기화

pcs host auth [Server Name] -u hacluster -p [Password]
pcs host auth con01 con02 con03 -u hacluster -p hacluster
> 서버 인증 진행

pcs cluster setup [Cluster Name] [Server Name]
pcs cluster setup Openstack con01 con02 con03
> 클러스터 구성 진행
-> 클러스터 구성이 정상적으로 진행되지 않을 경우 --force 옵션으로 강제성을 부여하여 진행

Cluster 상태 확인 및 모든 Cluster 기동

[Con01에서 진행]
pcs cluster status
> Cluster 상태정보 호출

pcs cluster start --all
> Clustering 되어 있는 모든 서버를 시작시킴

모든 노드 정상 시작시 pcs status를 통한 상태 정보 확인

Cluster name: openstack
Cluster Summary:
  * Stack: corosync
  * Current DC: con02 (version 2.1.2-ada5c3b36e2) - partition with quorum
  * Last updated: Fri Mar 29 22:25:29 2024
  * Last change:  Wed Mar 27 23:42:19 2024 by root via cibadmin on con1
  * 3 nodes configured

Node List:
  * Online: [ con01 con02 con03 ]

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

Stonith 비활성 및 Quorum 무시 설정

[Con01에서 진행]
pcs property set stonith-enabled=false
> 클러스터가 노드 장애를 감지했을 때 해당 노드를 자동으로 종료시키지 않도록 설정

pcs property set no-quorum-policy=ignore
> 쿼럼이 충족되지 않은 상태에서도 클러스터가 계속 작동하도록 설정.
  즉, 쿼럼이 없는 상태에서도 리소스 관리 결정이 계속 이루어지도록 함

VIP Resource 등록

[Con01에서 진행]
pcs resource create vip ocf:heartbeat:IPaddr2 ip=192.168.0.10 \
cidr_netmask=24 op monitor interval=20s

정상 등록 후 pcs status 를 통한 resource 정상 등록 여부 확인
...
Full List of Resources:
  * vip	(ocf:heartbeat:IPaddr2):	 Started con01
  
ip a s 명령시, 해당 대역이 지정되어 있는 네트워크 인터페이스에
Secondary IP로 Virtual IP 할당 됨

Fail-Over 테스트

[Con01에서 진행]
pcs node standby

pcs status

...
Node List:
  * Node con01: standby
  * Online: [ con02 con03 ]

Full List of Resources:
  * int_vip	(ocf:heartbeat:IPaddr2):	 Started con02
  
> Resource가 con02로 이동하는것을 확인, 리소스 가용성 확보
> pcs node unstandby를 통한 서버 재활성화
profile
인프라 엔지니어부터

0개의 댓글