SlideShare a Scribd company logo
MariaDB 이중화 구성하기
2020. 12.29
1
MariaDB 이중화 구성방식
추천
추천
추천
2
MariaDB 이중화 구성방식
* Master / Slave - MHA
#1(Master) #2(Slave)
WAS(n)
WAS1
VIP
MHA-Manager
Rea/Write
heart-beat
장애
#1(Dead) #2(Master)
WAS(n)
WAS1
VIP
MHA-Manager
Rea/Write
process-down
#3(Slave)
Auto Failover
- Role : Only Failover
- Master 장애 시 자동 Failover
+ Failover시 VIP를 #2으로 전환
+ #3를 #2으로 복제 자동전환
+ MHA-Manager는 Failover후 종료
+ Failover 후 DBA가 수동 복구 필요
- #1 Failback 절차
+ mha log에서 복제-position 확인
+ #1 기동 후 #2노드에
slave로 등록(change master to~)
+ #1노드의 복제 데이터 최신화
+ MHA-Manager로 Online switchover 수행
+ MHA-Manager 기동
#3(Slave)
Manual Failback
3
MariaDB 이중화 구성방식
* Master / Slave - MaxScale
#1(Master) #2(Slave)
WAS(n)
WAS1
MaxScale
heart-beat
장애
#3(Slave)
Auto Failover
- Role : Connection Router & Failover(HA)
- Master 장애 시 자동 Failover
+ #2를 Master로 자동전환
+ #3를 #2으로 Slave로 자동전환
+ #2로 Write Connection Routing
- #1 Failback 절차
+ #1 기동하면 자동으로 #2의 Slave로 등록
+ #1로 Read Connection Routing
+ DBA가 MaxAdmin으로 Online switchover 수행
- MariaDB 전용 HA솔루션
Auto Rejoin
heart-beat
Write Read
Read
#1(Dead) #2(Master)
WAS(n)
WAS1
MaxScale
#3(Slave)
heart-beat
Write
Read

Recommended for you

How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale

MaxScale is a database proxy that provides load balancing, connection pooling, and replication capabilities for MariaDB and MySQL databases. It can be used to scale databases horizontally across multiple servers for increased performance and availability. The document provides an overview of MaxScale concepts and capabilities such as routing, filtering, security features, and how it can be used for operational tasks like query caching, logging, and data streaming. It also includes instructions on setting up MaxScale with a basic example of configuring read/write splitting between a master and slave database servers.

mariadbmaxscaleopen source
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale

MariaDB MaxScale is a database proxy that provides scalability, high availability, and data streaming capabilities for MariaDB and MySQL databases. It acts as a load balancer and router to distribute queries across database servers. MaxScale supports services like read/write splitting, query caching, and security features like selective data masking. It can monitor replication lag and route queries accordingly. MaxScale uses a plugin architecture and its core remains stateless to provide flexibility and high performance.

mariadbmaxscaleopen source
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx

개발자를 위한 MySQL의 기본 이해.

4
MariaDB 이중화 구성방식
* Multi-Master - L4
#1(Master) #2(Slave)
WAS(n)
WAS1
heart-beat
장애
Auto Failover
- Role : Connection Router & Failover(HA)
+ 단일노드로 Connection Routing(분산처리 아님)
- Master 장애 시 자동 Failover
+ L4가 #2로 Read/Write Connection 자동전환
- #1 Failback 절차
+ #1 서비스 포트 변경(33063307)
+ #1 기동하면 자동으로 복제됨
+ #1의 복제 최신화
+ #1 서비스 중지 후 포트 원위치(3306) 후 기동
+ L4설정에 따라 #2 이나 #1으로 Connection 전환
Manual Rejoin
heart-beat
Read/Write
L4
#1(Dead) #2(Master)
WAS(n)
WAS1
heart-beat heart-beat
Read/Write
L4
5
MariaDB 이중화 구성방식
#1(Master) #2(Slave)
WAS(n)
WAS1
MaxScale
heart-beat
장애
Auto Failover
- Role : Connection Router & Failover(HA)
- Master 장애 시 자동 Failover
+ #2를 Master로 자동전환
+ #2로 Write/Connection Connection Routing
- #1 Failback 절차
+ #1 기동하면 auto rejoin
+ #1의 복제 최신화
+ #1은 자동으로 Read Connection
+ DBA가 MaxAdmin으로 Online Switchover 수행가능
- MariaDB 전용 HA솔루션
Auto Rejoin
heart-beat
Write Read
* Multi-Master - MaxScale
#1(Dead) #2(Slave)
WAS(n)
WAS1
MaxScale
heart-beat heart-beat
Write
Read
6
MariaDB 이중화 구성방식
* Multi-Source - MHA
#1(Master) #2(Master)
WAS(n)
WAS1
VIP1
MHA-Manager1
Read/Write
heart-beat
장애
#3(Slave)
Auto Failover
- Role : Only Failover
- Master 장애 시 자동 Failover
+ Failover시 VIP1를 #3으로 전환
+ MHA-Manager1은 Failover후 종료
+ Failover 후 DBA가 수동 복구 필요
- #1 Failback 절차
+ 다소 까다로움으로 주의가 필요.
+ mha log에서 복제-position 확인
+ #1 기동 후 #3노드에
특정DB만 복제하도록 slave로 등록
+ #1노드의 복제 데이터 최신화
+ MHA-Manager1로 Online switchover 수행
+ MHA-Manager1 기동
Manual Failback
VIP2
Read/Write
MHA-Manager2
heart-beat
#1(Dead) #2(Master)
WAS(n)
WAS1
VIP1
MHA-Manager1
Read/Write
process down
#3(Master | Slave)
VIP2
Read/Write
MHA-Manager2
heart-beat
7
MariaDB 이중화 구성방식
* Multi-Source - MaxScale
#1(Master) #2(Master)
WAS(n)
WAS1
Read/Write
heart-beat
장애
#3(Slave)
Auto Failover
- Role : Connection Router & Failover(HA)
- Master 장애 시 자동 Failover
+ #3으로 Connection 자동전환
+
- #1 Failback 절차
+ #1 기동 하면 #3의 Slave로 자동등록
+ #1 복제 데이터 최신화
+ #1은 Read Connection 수행가능
+ DBA가 MaxAdmin으로
Online Switchover 수행가능
- MariaDB 전용 HA솔루션
Auto Rejoin
Read/Write
heart-beat
MaxScale
MaxScale
#1(Dead) #2(Master)
WAS(n)
WAS1
Read/Write
#3(Master | Slave)
Read/Write
heart-beat
MaxScale
MaxScale

Recommended for you

MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)

MariaDB 10.5 binary install (바이너리 설치) - 네오클로바 DB지원사업부 1. About MariaDB 1.1 MariaDB 개요 1.2 MariaDB as a R-DBMS 1.3 Open Source Database System 2. 설치 2.1 설치 기본 정보 2.2 설치 준비 2.3 MariaDB 설치 2.4 MariaDB 시작 / 접속 / 종료 2.5 추가 설정

mariadbmysqlopensource
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법

MySQL 소개 간략한 소개 version history MySQL 사용처 제품 군 변화 시장 변화 MySQL 구성 MySQL 클라이언트 / 서버 개념 클라이언트 프로그램 MySQL 설치 MySQL 버전 MySQL 설치 MySQL 환경 설정 환경설정, 변수 설정 MySQL 스토리지 엔진 소개 MySQL tuning 소개 및 방법 데이터 백업/복구 방법 백업 복구 MySQL Upgrade

MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx

The document discusses the Performance Schema in MySQL. It provides an overview of what the Performance Schema is and how it can be used to monitor events within a MySQL server. It also describes how to configure the Performance Schema by setting up actors, objects, instruments, consumers and threads to control what is monitored. Finally, it explains how to initialize the Performance Schema by truncating existing summary tables before collecting new performance data.

8
MariaDB 이중화 구성방식
* Galera Cluster - L4
#1 #3
WAS(n)
WAS1
장애
Auto Failover
- Role : Connection Router & Failover(HA)
+ #1 Write Connection, 나머지는 Read Connection
+ Read와 Write Connection Port가 다름
- #1 장애 시 자동 Failover
+ L4가 #2로 Write Connection 자동전환
- #1 Failback 절차
+ #1의 L4상의 Write Connection 가중치 조정(하향)
+ #1 기동하면 자동으로 데이터동기화(SST/IST)
+ #1 동기화 완료 후 L4상의 가중치 조정(상향)
+ DBA가 아닌 N/W 담당자의 조치 필요
+ L4 환경 구성의 주의
Manual Rejoin
Write
L4(another port)
#2
Read
Read
#1(Dead) #3
WAS(n)
WAS1
Write
L4(another port)
#2
Read
Read
9
MariaDB 이중화 구성방식
WAS(n)
WAS1
MaxScale
Auto Failover
- Role : Connection Router & Failover(HA)
+ Read와 Write Connection 포트 동일
- #1 장애 시 자동 Failover
+ #2로 Write Connection 자동전환
- #1 Failback 절차
+ #1 기동하면 자동으로 데이터동기화(SST/IST)
+ #1 동기화 완료 후 자동으로 Read Connection수행
+ DBA가 MaxAdmin으로 Online Switchover 수행가능
- MariaDB 전용 HA솔루션
Auto Rejoin
Write
* Galera Cluster - MaxScale
#1 #3
장애
#2
Read
Read
WAS(n)
WAS1
MaxScale
Write
#1(Dead) #3
#2
Read
Read
10
MariaDB 이중화 구성
* HA 솔루션 별 비교
구분 MHA MaxScale L4
Load-Balancing 미지원 지원 지원
Auto-Failover 지원 지원 지원
Auto Replication
(역복제)
미지원 지원 미지원
Auto-Rejoin 미지원 지원 지원
VIP 필요 불필요 필요
GTID 선택 필수 선택
이중화
불가능 가능 가능
* MaxScale의 장점
- 문의하신 Connection을 Write Connection과 Read-Only Conneciton으로 자동분기처리해서
Master노드로 Write Connection을, Read-Only Connection은 Slaves 노드들로 분산처리 합니다.
- 이와 유사한 기능하는 솔루션으로 ProxySQL이 있으나 ProxySQL은 Master노드에 대한 장애시 HA기능을 지원하지 않습니다.
따라서 ProxySQL을 사용하는경우는 MHA등 HA전용솔루션과 함께 사용해야 합니다.
- MaxScale은 Backend DB가 2대인경우는 무상으로 사용가능하나, 3대 이상인경우는 Subscription이 필요합니다.(BSL)
- 또한 MaxScale은 다운된 Master노드를 재기동만 해주더라도 자동으로 복제를 연결하고
완료된 경우 서비스노드로 자동 추가합니다.
* MaxScale의 주요기능
- Auto-Failover
- Transaction Reply
- Read-Write Connection Splitting
- Replication Server(Binlog Server)
- Data Masking
- Query Blocking
- Result limiting
- Change-Data-Capture
- Kafka Connection
MariaDB들의 복제구성에 상관없이 HA솔루션으로
MaxScale을 추천드립니다.
11
MariaDB 이중화 구성 – 1안
* Master / Slave - MaxScale ( Active – Active)
#1(Master) #2(Slave)
WAS(n)
WAS1
MaxScale
#3(Slave)
Read
MaxScale
L4
Write Read
- L4
- VIP할당
- 특정 포트에 대하여 2대의
Maxscale로 분산처리
- 특정 Maxscale장애 시 한쪽 노드로
Routing수행
- MaxScale
- R/W Connection에 대한
지능적인 자동 분산처리
- Master장애시 Slave를 신규 Master
로 승격
- 기타 Slaves를 신규 Master로 연결
- Dead Master가 Online시 Slave로
자동 Join 수행
- Replication Lag에 대한 유연한
Transaction 제어(causal read)
- Master
- Read/Write Transaction 수행
- Slave
- Read Transaction 수행
- Master로부터의 Replication 수행
추천

Recommended for you

Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )

MySQL Clustering over InnoDB engines has grown a lot over the last decade. Galera began working with InnoDB early and then Group Replication came to the environment later, where the features are now rich and robust. This presentation offers a technical comparison of both of them.

#mysql#clustering#galera
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers

The document discusses running MariaDB across multiple data centers. It begins by outlining the need for multi-datacenter database architectures to provide high availability, disaster recovery, and continuous operation. It then describes topology choices for different use cases, including traditional disaster recovery, geo-synchronous distributed architectures, and how technologies like MariaDB Master/Slave and Galera Cluster work. The rest of the document discusses answering key questions when designing a multi-datacenter topology, trade-offs to consider, architecture technologies, and pros and cons of different approaches.

MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개

오픈소스 데이터베이스 MariaDB 아키텍처, 이중화 관련 제품 소개

mariadbmysqlneoclova
12
MariaDB 이중화 구성 – 2안
* Master / Slave - MaxScale ( Active – Standby )
#1(Master) #2(Slave)
WAS(n)
WAS1
MaxScale
#3(Slave)
Read
MaxScale
Write Read
- Keepalived
- VIP제어
- VIP할당노드로 Connection 인입
- 노드장애 시 Standby Maxsclae로
VIP 전환
- MaxScale
- R/W Connection에 대한
지능적인 자동 분산처리
- Master장애시 Slave를 신규 Master
로 승격
- 기타 Slaves를 신규 Master로 연결
- Dead Master가 Online시 Slave로
자동 Join 수행
- Replication Lag에 대한 유연한
Transaction 제어(causal read)
- Master
- Read/Write Transaction 수행
- Slave
- Read Transaction 수행
- Master로부터의 Replication 수행
VIP
Keepalived
13
MariaDB/MaxScale 버전 및 Subscription (2021-12-30기준)
* MariaDB Version 선택
구분(GPL) GA-Start EOL 최신
10.2 2017-04-23 2022-04-23 10.2.41
10.3 2018-04-25 2023-04-25 10.3.32
10.4 2019-06-18 2024-06-18 10.4.22
10.5 2020-06-24 2025-06-24 10.5.13
10.6 2021-07-06 2026-07-06 10.6.5
10.7 - - 10.7.1
* MaxScale Version 선택
추천
구분(BSL) GA-Start EOL 최신
2.2 2018-02-01
Minor버전별
차이.
대략 4년
2.2.21
2.3 2018-10-09 2.3.20
2.4 2019-06-29 2.4.18
2.5 2020-10-19 2.5.14
6.1 2021-07-15 6.1.4
6.2 2021-11-26 6.2.0
추천
- GA-Start이후 1년 ~ 1.5년 이후버전
- Minor 버전 x.20 이상 선택
Minor버전이 낮으면 잦은 버그를 인한 장애가능성 있음
- Subscription 구매 시
Enterprise Server에 추가된 HA관련 파라미터 추가지원
shutdown_wait_for_slaves
- Bug에 대한 신속한 Hot-Fix 및 SR 지원을 위해서는
Subscription 필요
- GA-Start이후 1년 ~ 1.5년 이후버전
- 서비스 운영성을 높이기 위해서는
Cooperative Monitoring(2.5이상) 필요
- MaxScale설정에 Backend Server 수가
2대 이하는 무상 이용가능
3대 이상은 Subscription 필요
- MaxScale만의 Subscription은 제공되지 않으며,
MariaDB Enterprise Subscription 구매 시
MaxScale이 포함되어 있음.
감사합니다

More Related Content

What's hot

[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
NAVER D2
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
NeoClova
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
NeoClova
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
MariaDB plc
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
MariaDB plc
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
NeoClova
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
NeoClova
 
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
Ji-Woong Choi
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
NeoClova
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
MariaDB plc
 
MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개
NeoClova
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
MariaDB plc
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
I Goo Lee
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
Mydbops
 
NY Meetup: Scaling MariaDB with Maxscale
NY Meetup: Scaling MariaDB with MaxscaleNY Meetup: Scaling MariaDB with Maxscale
NY Meetup: Scaling MariaDB with Maxscale
Wagner Bianchi
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High Availability
MariaDB plc
 
MySQL InnoDB Cluster 소개
MySQL InnoDB Cluster 소개MySQL InnoDB Cluster 소개
MySQL InnoDB Cluster 소개
rockplace
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
MariaDB plc
 

What's hot (20)

[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
[135] 오픈소스 데이터베이스, 은행 서비스에 첫발을 내밀다.
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
 
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
NY Meetup: Scaling MariaDB with Maxscale
NY Meetup: Scaling MariaDB with MaxscaleNY Meetup: Scaling MariaDB with Maxscale
NY Meetup: Scaling MariaDB with Maxscale
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High Availability
 
MySQL InnoDB Cluster 소개
MySQL InnoDB Cluster 소개MySQL InnoDB Cluster 소개
MySQL InnoDB Cluster 소개
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
 

Maria db 이중화구성_고민하기

  • 3. 2 MariaDB 이중화 구성방식 * Master / Slave - MHA #1(Master) #2(Slave) WAS(n) WAS1 VIP MHA-Manager Rea/Write heart-beat 장애 #1(Dead) #2(Master) WAS(n) WAS1 VIP MHA-Manager Rea/Write process-down #3(Slave) Auto Failover - Role : Only Failover - Master 장애 시 자동 Failover + Failover시 VIP를 #2으로 전환 + #3를 #2으로 복제 자동전환 + MHA-Manager는 Failover후 종료 + Failover 후 DBA가 수동 복구 필요 - #1 Failback 절차 + mha log에서 복제-position 확인 + #1 기동 후 #2노드에 slave로 등록(change master to~) + #1노드의 복제 데이터 최신화 + MHA-Manager로 Online switchover 수행 + MHA-Manager 기동 #3(Slave) Manual Failback
  • 4. 3 MariaDB 이중화 구성방식 * Master / Slave - MaxScale #1(Master) #2(Slave) WAS(n) WAS1 MaxScale heart-beat 장애 #3(Slave) Auto Failover - Role : Connection Router & Failover(HA) - Master 장애 시 자동 Failover + #2를 Master로 자동전환 + #3를 #2으로 Slave로 자동전환 + #2로 Write Connection Routing - #1 Failback 절차 + #1 기동하면 자동으로 #2의 Slave로 등록 + #1로 Read Connection Routing + DBA가 MaxAdmin으로 Online switchover 수행 - MariaDB 전용 HA솔루션 Auto Rejoin heart-beat Write Read Read #1(Dead) #2(Master) WAS(n) WAS1 MaxScale #3(Slave) heart-beat Write Read
  • 5. 4 MariaDB 이중화 구성방식 * Multi-Master - L4 #1(Master) #2(Slave) WAS(n) WAS1 heart-beat 장애 Auto Failover - Role : Connection Router & Failover(HA) + 단일노드로 Connection Routing(분산처리 아님) - Master 장애 시 자동 Failover + L4가 #2로 Read/Write Connection 자동전환 - #1 Failback 절차 + #1 서비스 포트 변경(33063307) + #1 기동하면 자동으로 복제됨 + #1의 복제 최신화 + #1 서비스 중지 후 포트 원위치(3306) 후 기동 + L4설정에 따라 #2 이나 #1으로 Connection 전환 Manual Rejoin heart-beat Read/Write L4 #1(Dead) #2(Master) WAS(n) WAS1 heart-beat heart-beat Read/Write L4
  • 6. 5 MariaDB 이중화 구성방식 #1(Master) #2(Slave) WAS(n) WAS1 MaxScale heart-beat 장애 Auto Failover - Role : Connection Router & Failover(HA) - Master 장애 시 자동 Failover + #2를 Master로 자동전환 + #2로 Write/Connection Connection Routing - #1 Failback 절차 + #1 기동하면 auto rejoin + #1의 복제 최신화 + #1은 자동으로 Read Connection + DBA가 MaxAdmin으로 Online Switchover 수행가능 - MariaDB 전용 HA솔루션 Auto Rejoin heart-beat Write Read * Multi-Master - MaxScale #1(Dead) #2(Slave) WAS(n) WAS1 MaxScale heart-beat heart-beat Write Read
  • 7. 6 MariaDB 이중화 구성방식 * Multi-Source - MHA #1(Master) #2(Master) WAS(n) WAS1 VIP1 MHA-Manager1 Read/Write heart-beat 장애 #3(Slave) Auto Failover - Role : Only Failover - Master 장애 시 자동 Failover + Failover시 VIP1를 #3으로 전환 + MHA-Manager1은 Failover후 종료 + Failover 후 DBA가 수동 복구 필요 - #1 Failback 절차 + 다소 까다로움으로 주의가 필요. + mha log에서 복제-position 확인 + #1 기동 후 #3노드에 특정DB만 복제하도록 slave로 등록 + #1노드의 복제 데이터 최신화 + MHA-Manager1로 Online switchover 수행 + MHA-Manager1 기동 Manual Failback VIP2 Read/Write MHA-Manager2 heart-beat #1(Dead) #2(Master) WAS(n) WAS1 VIP1 MHA-Manager1 Read/Write process down #3(Master | Slave) VIP2 Read/Write MHA-Manager2 heart-beat
  • 8. 7 MariaDB 이중화 구성방식 * Multi-Source - MaxScale #1(Master) #2(Master) WAS(n) WAS1 Read/Write heart-beat 장애 #3(Slave) Auto Failover - Role : Connection Router & Failover(HA) - Master 장애 시 자동 Failover + #3으로 Connection 자동전환 + - #1 Failback 절차 + #1 기동 하면 #3의 Slave로 자동등록 + #1 복제 데이터 최신화 + #1은 Read Connection 수행가능 + DBA가 MaxAdmin으로 Online Switchover 수행가능 - MariaDB 전용 HA솔루션 Auto Rejoin Read/Write heart-beat MaxScale MaxScale #1(Dead) #2(Master) WAS(n) WAS1 Read/Write #3(Master | Slave) Read/Write heart-beat MaxScale MaxScale
  • 9. 8 MariaDB 이중화 구성방식 * Galera Cluster - L4 #1 #3 WAS(n) WAS1 장애 Auto Failover - Role : Connection Router & Failover(HA) + #1 Write Connection, 나머지는 Read Connection + Read와 Write Connection Port가 다름 - #1 장애 시 자동 Failover + L4가 #2로 Write Connection 자동전환 - #1 Failback 절차 + #1의 L4상의 Write Connection 가중치 조정(하향) + #1 기동하면 자동으로 데이터동기화(SST/IST) + #1 동기화 완료 후 L4상의 가중치 조정(상향) + DBA가 아닌 N/W 담당자의 조치 필요 + L4 환경 구성의 주의 Manual Rejoin Write L4(another port) #2 Read Read #1(Dead) #3 WAS(n) WAS1 Write L4(another port) #2 Read Read
  • 10. 9 MariaDB 이중화 구성방식 WAS(n) WAS1 MaxScale Auto Failover - Role : Connection Router & Failover(HA) + Read와 Write Connection 포트 동일 - #1 장애 시 자동 Failover + #2로 Write Connection 자동전환 - #1 Failback 절차 + #1 기동하면 자동으로 데이터동기화(SST/IST) + #1 동기화 완료 후 자동으로 Read Connection수행 + DBA가 MaxAdmin으로 Online Switchover 수행가능 - MariaDB 전용 HA솔루션 Auto Rejoin Write * Galera Cluster - MaxScale #1 #3 장애 #2 Read Read WAS(n) WAS1 MaxScale Write #1(Dead) #3 #2 Read Read
  • 11. 10 MariaDB 이중화 구성 * HA 솔루션 별 비교 구분 MHA MaxScale L4 Load-Balancing 미지원 지원 지원 Auto-Failover 지원 지원 지원 Auto Replication (역복제) 미지원 지원 미지원 Auto-Rejoin 미지원 지원 지원 VIP 필요 불필요 필요 GTID 선택 필수 선택 이중화 불가능 가능 가능 * MaxScale의 장점 - 문의하신 Connection을 Write Connection과 Read-Only Conneciton으로 자동분기처리해서 Master노드로 Write Connection을, Read-Only Connection은 Slaves 노드들로 분산처리 합니다. - 이와 유사한 기능하는 솔루션으로 ProxySQL이 있으나 ProxySQL은 Master노드에 대한 장애시 HA기능을 지원하지 않습니다. 따라서 ProxySQL을 사용하는경우는 MHA등 HA전용솔루션과 함께 사용해야 합니다. - MaxScale은 Backend DB가 2대인경우는 무상으로 사용가능하나, 3대 이상인경우는 Subscription이 필요합니다.(BSL) - 또한 MaxScale은 다운된 Master노드를 재기동만 해주더라도 자동으로 복제를 연결하고 완료된 경우 서비스노드로 자동 추가합니다. * MaxScale의 주요기능 - Auto-Failover - Transaction Reply - Read-Write Connection Splitting - Replication Server(Binlog Server) - Data Masking - Query Blocking - Result limiting - Change-Data-Capture - Kafka Connection MariaDB들의 복제구성에 상관없이 HA솔루션으로 MaxScale을 추천드립니다.
  • 12. 11 MariaDB 이중화 구성 – 1안 * Master / Slave - MaxScale ( Active – Active) #1(Master) #2(Slave) WAS(n) WAS1 MaxScale #3(Slave) Read MaxScale L4 Write Read - L4 - VIP할당 - 특정 포트에 대하여 2대의 Maxscale로 분산처리 - 특정 Maxscale장애 시 한쪽 노드로 Routing수행 - MaxScale - R/W Connection에 대한 지능적인 자동 분산처리 - Master장애시 Slave를 신규 Master 로 승격 - 기타 Slaves를 신규 Master로 연결 - Dead Master가 Online시 Slave로 자동 Join 수행 - Replication Lag에 대한 유연한 Transaction 제어(causal read) - Master - Read/Write Transaction 수행 - Slave - Read Transaction 수행 - Master로부터의 Replication 수행 추천
  • 13. 12 MariaDB 이중화 구성 – 2안 * Master / Slave - MaxScale ( Active – Standby ) #1(Master) #2(Slave) WAS(n) WAS1 MaxScale #3(Slave) Read MaxScale Write Read - Keepalived - VIP제어 - VIP할당노드로 Connection 인입 - 노드장애 시 Standby Maxsclae로 VIP 전환 - MaxScale - R/W Connection에 대한 지능적인 자동 분산처리 - Master장애시 Slave를 신규 Master 로 승격 - 기타 Slaves를 신규 Master로 연결 - Dead Master가 Online시 Slave로 자동 Join 수행 - Replication Lag에 대한 유연한 Transaction 제어(causal read) - Master - Read/Write Transaction 수행 - Slave - Read Transaction 수행 - Master로부터의 Replication 수행 VIP Keepalived
  • 14. 13 MariaDB/MaxScale 버전 및 Subscription (2021-12-30기준) * MariaDB Version 선택 구분(GPL) GA-Start EOL 최신 10.2 2017-04-23 2022-04-23 10.2.41 10.3 2018-04-25 2023-04-25 10.3.32 10.4 2019-06-18 2024-06-18 10.4.22 10.5 2020-06-24 2025-06-24 10.5.13 10.6 2021-07-06 2026-07-06 10.6.5 10.7 - - 10.7.1 * MaxScale Version 선택 추천 구분(BSL) GA-Start EOL 최신 2.2 2018-02-01 Minor버전별 차이. 대략 4년 2.2.21 2.3 2018-10-09 2.3.20 2.4 2019-06-29 2.4.18 2.5 2020-10-19 2.5.14 6.1 2021-07-15 6.1.4 6.2 2021-11-26 6.2.0 추천 - GA-Start이후 1년 ~ 1.5년 이후버전 - Minor 버전 x.20 이상 선택 Minor버전이 낮으면 잦은 버그를 인한 장애가능성 있음 - Subscription 구매 시 Enterprise Server에 추가된 HA관련 파라미터 추가지원 shutdown_wait_for_slaves - Bug에 대한 신속한 Hot-Fix 및 SR 지원을 위해서는 Subscription 필요 - GA-Start이후 1년 ~ 1.5년 이후버전 - 서비스 운영성을 높이기 위해서는 Cooperative Monitoring(2.5이상) 필요 - MaxScale설정에 Backend Server 수가 2대 이하는 무상 이용가능 3대 이상은 Subscription 필요 - MaxScale만의 Subscription은 제공되지 않으며, MariaDB Enterprise Subscription 구매 시 MaxScale이 포함되어 있음.