카테고리 없음

Mariadb Gcache_page 이슈

ksk04 2025. 12. 27. 18:27

Mariadb 클러스터 재기동과정에서 Gcache 패이지가 삭제되지 않고 계속적으로 축적되는 상황이 발생.

Mariadb 엔터프라이즈 측에서는 DB 엔진과 Galera cluster 간의 버전 호환성이슈로 가이드 받음.

  • 작업 순서
 1.DR 0번 1번 Mariadb DB 중지
 2.DR 0번 1번의 Gcache.page 파일을 삭제
 3.DR 0번 1번서버에 데이터 파일 삭제 (경로 : /data/dbdata)
 4.DR 2번 에서 MariaDB Full Backup
 5.DR 2번에서 받은 Full Backup본을 DR 0번 1번 서버로 Restore 
 6.DR 0번 1번 MariaDB 기동.
 7.갈레라 동기화 확인.

  1. dr 0번 1번 서버 중지
systemctl stop mariadb
  1. dr 0번 1번 서버에서 gcache 페이지를 삭제
- 경로 : /data/dbdata # data 경로
shell> rm -f *gcache.page*
  1. DR 0번 1번서버에 데이터 파일 삭제 (경로 : /data/dbdata)
rm -f /data/dbdata/* 
  1. DR 2번에서 MariaDB Full Backup
# DR 2번 서버에서 작업.
shell> mariabackup --backup --target-dir=/백업경로 --user=백업유저 --password=패스워드 
shell> mariabackup --prepare --target-dir=/백업경로
  1. DR 2번에서 받은 Full Backup 본을 DR 0번 1번 서버로 Resotre
# DR 2번의 백업본을 DR 0번 1번 서버로 옮기기 
shell> ll /백업경로
shell> rm -rf /data/dbdata # data

# DR 0번 1번 서버에서 작업.
shell>  mariabackup --copy-back --target-dir=/백업본 경로
shell> chown -R mariadb:mariadb /data/dbdata/*
  1. DR 0번 1번서버 Mariadb 기동.
# DR 0번 1번 서버에서 작업
shell> systemctl start mariadb
  1. DR 모든 서버에서 동기화 확인
shell> mysql -uroot -p
MariaDB> show status like 'wsrep_%';
  • 아래의 파라미터를 확인.
    • wsrep_local_state_comment : 최종적으로 모든 노드가 synced 인지를 확인
    • wsrep_cluster_status : ON
    • wsrep_cluster_size : 모든 노드가 클러스터 가입을 확인
    show status like 'wsrep_cluster_size'