System/작업LOG
[2020-02-19] CentOS-MariaDB MHA 테스트
클리엘
2020. 2. 28. 18:00
728x90
1. MHA 기동 (기동전 MHA check필수)
masterha_manager --conf=/etc/mha.cnf &
2. Master DB 중지
systemctl stop mysqld
3. 확인 절차
(1) Slave DB
show variables like 'read_only';
결과 -> read_only가 OFF로 표시되면 Master DB로 승격되었음을 의미
MariaDB> show master status\G;
*************************** 1. row ***************************
File: mysql-bin.000004
Position: 677
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.000 sec)
ERROR: No query specified
MariaDB> show slave status\G;
Empty set (0.000 sec)
ERROR: No query specified
결과 -> show slave status\G; 했을 때 Empty set이 나오면 Master DB로 승격되었음을 의미
(2) Master와 Slave의 가상 IP상태
ip a s eth3:0
-> 가상 ip가 나오면 up상태 안 나오면 down상태
failover가 진행되면 master는 down, slave는 up상태 이어야 함.
728x90