티스토리 뷰

Linux

centos7 HA (heartbeat) coresync, pcs, peacemaker

초보의 CHOMAN 2018.05.15 13:30


centos7 HA (heartbeat)




CENTOS7 에서는 기존까지 사용하던 Heartbeat 패키지가 보이지 않아서 아래와 같이 HA를 구성해보았다.




원문 참고 사이트



https://blog.boxcorea.com/wp/archives/1784

 





cat /etc/hosts



123.456.789.140 WEB1

123.456.789.141 WEB2

123.456.789.144 WEBM

 





설치



yum install -y pacemaker corosync pcs psmisc policycoreutils-python

 





데몬 실행



systemctl start pcsd.service

systemctl enable pcsd.service

Created symlink from /etc/systemd/system/multi-user.target.wants/pcsd.service to /usr/lib/systemd/system/pcsd.service.








[root@localhost ~]# passwd hacluster

hacluster 사용자의 비밀 번호 변경 중

새  암호:

새  암호 재입력:

passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.







[root@localhost ~]# pcs cluster auth WEB1 WEB2

Username: hacluster

Password: 

web2: Authorized

web1: Authorized

 






[root@localhost ~]# pcs cluster setup --name web_cluster web1 web2

Destroying cluster on nodes: web1, web2...

web1: Stopping Cluster (pacemaker)...

web2: Stopping Cluster (pacemaker)...

web1: Successfully destroyed cluster

web2: Successfully destroyed cluster

 

Sending 'pacemaker_remote authkey' to 'web1', 'web2'

web1: successful distribution of the file 'pacemaker_remote authkey'

web2: successful distribution of the file 'pacemaker_remote authkey'

Sending cluster config files to the nodes...

web1: Succeeded

web2: Succeeded


Synchronizing pcsd certificates on nodes web1, web2...

web2: Success

web1: Success

Restarting pcsd on the nodes in order to reload the certificates...

web2: Success

web1: Success







[root@localhost ~]# pcs cluster start --all

web2: Starting Cluster...

web1: Starting Cluster...

 





[root@localhost ~]# corosync-cfgtool -s

Printing ring status.

Local node ID 1

RING ID 0

id = 123.456.789.140

status = ring 0 active with no faults

 





[root@localhost ~]# corosync-cfgtool -s

Printing ring status.

Local node ID 2

RING ID 0

id = 123.456.789.141

status = ring 0 active with no faults

 






[root@localhost ~]# corosync-cmapctl | egrep -i members

runtime.totem.pg.mrp.srp.members.1.config_version (u64) = 0

runtime.totem.pg.mrp.srp.members.1.ip (str) = r(0) ip(123.456.789.140) 

runtime.totem.pg.mrp.srp.members.1.join_count (u32) = 1

runtime.totem.pg.mrp.srp.members.1.status (str) = joined

runtime.totem.pg.mrp.srp.members.2.config_version (u64) = 0

runtime.totem.pg.mrp.srp.members.2.ip (str) = r(0) ip(123.456.789.141) 

runtime.totem.pg.mrp.srp.members.2.join_count (u32) = 1

runtime.totem.pg.mrp.srp.members.2.status (str) = joined

 





pcs status corosync



Membership information

----------------------

    Nodeid      Votes Name

         1          1 web1 (local)

         2          1 web2

 





[root@localhost ~]# crm_verify -L -V



   error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined

   error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option

   error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity

Errors found during check: config not valid

 





[root@localhost ~]# pcs property set stonith-enabled=false

[root@localhost ~]# crm_verify -L -V

 







'Linux' 카테고리의 다른 글

centos 5 버전 다운로드  (0) 2018.08.22
sysbench  (0) 2018.05.16
centos7 HA (heartbeat) coresync, pcs, peacemaker  (0) 2018.05.15
mod_status (아파치 상태 모니터링)  (0) 2018.05.08
mod-auth-token (OTP URL)  (0) 2018.04.24
iptables-extensions  (0) 2018.04.02
댓글
댓글쓰기 폼