0% found this document useful (0 votes)
23 views13 pages

Replication MariaDB

The document provides an overview of MariaDB replication, focusing on high availability, configuration, and switchover/failover processes. It discusses synchronous (Galera) and asynchronous (Master-Slave) replication methods, as well as the role of MaxScale in enhancing load balancing and security. Additionally, it introduces Global Transaction ID (GTID) based replication for improved transaction tracking and data consistency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views13 pages

Replication MariaDB

The document provides an overview of MariaDB replication, focusing on high availability, configuration, and switchover/failover processes. It discusses synchronous (Galera) and asynchronous (Master-Slave) replication methods, as well as the role of MaxScale in enhancing load balancing and security. Additionally, it introduces Global Transaction ID (GTID) based replication for improved transaction tracking and data consistency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

MariaDB Replication

Farid Adam Abdillah / 9673


Astra Graphia Information Technology
01 High Availability 02 Replication
 High Availability Defined  Architecture Replication

 High Availability Component  Master-Slave Replication with Maxscale

 High Availability MariaDB

03 Configuration 04 Switchover & Failover


 Preparation  How to Switchover

 Configuration Master-Slave Replication  How to Failover

Overview  Configuration Maxscale & Administration


High
Availability
Defined
In information Technology, high availability
refers to a system or component that is
continuously operational for a desirably
long length of time

Availability – Wikipedia
Up time / total time
Approach to High Availability
Strategies for High Availability

Other
5

~ 99.99%
52.6 min / year ~ 99.999%
< 99.9% Replication / Automatic
failover
4 5.3 min / year
Galera Cluster
3 – 7 days / year
Backup / restore

3
2
1
~ 99.9%
8.8 Hs / year
simple replication /
manual failover
High Availability Components
High availability is a system design protocol and associated implementation that ensures a
certain degree of operational continuity during a measurement period.

Failover or
Monitoring and Data
Switchover
Management Redundancy
Solution

Availability of the services needs to Some mechanism to redirect traffic For Stateful services, we need to
be monitored, to take action when from the failed server or datacenter to make sure that data is made
there is failure or even to prevent a working one redundant. It is not a replacement for
them backup!
Synchronous Replication
(Galera)

• Galera Replication is a synchronous multi-master


replication plug-in that enables a true master-master
setup for innoDB
• Every component of the cluster (node) is a share
nothing server
• All nodes are masters and applications can read and
write from any node
• A minimal Galera cluster consists of 3 nodes:
• A proper cluster needs to reach a quorum (i.e. the
majority of the nodes of the cluster)
• Transactions are synchronously committed on all
nodes.
Asynchronous Replication
(Master-Slave)

Master Slave Replication is Asynchronous Replication


• Write Operations on the Master
• Data Replication to Slaves
• Read Operations on the Slaves
MaxScale with HA
Purpose of Maxscale:

• Load Balancing
• Query Routing
• High Availability
• Scalability
• Security
• Protocol Conversion
• Query Caching
Preparation
Prepare 4 VM :
Node1 :192.168.174.130 (192.168.174.130 node1.example.com node1)
Node2 :192.168.174.131 (192.168.174.131 node2.example.com node2)
Max :192.168.174.132 (192.168.174.132 max.example.com max)
Mon :192.168.174.129 (192.168.174.129 mon.example.com mon)

Linux CentOs 9 Stream

MariaDB 10.11 on: Node1, Node2


MaxScale: on Max VM

Disk partitioning:
/data
/backup
/log
/tools
System (/boot, /swap, /)
Global Transaction ID (GTID)

• A unique identifier assigned to each


transaction within a database cluster
• Track and replicate transactions across
servers
• Ensure data consistency and make
replication more robust and easier to
manage
HOW GTID-Based Replication Works

• A GTID is assigned to each transaction


• The primary server log each transaction with its GTID in the binary log
• The replica server reads the binary log, identifies transactions using GTIDs, and applies
them in order
• Replica keep track of the GTIDs they have already processed, ensuring no transaction is
applied twice
Benefits of GTID-Based Replication

• Simplifies Replication Management


• Ensures Data Consistency
• Supports Multi-Source Replication
• Easier Recovery
THANK YOU

You might also like