MySQL_Replication_Light_Theme_Presentation.pptx replication presentation

VITS184D1 7 views 15 slides Oct 28, 2025
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

mysql replication


Slide Content

MySQL Replication

Agenda • Basics of Replication • Why Replication Needed • Types Of Replication • Replication For MySQL • Configuring MySQL Replication • Testing a Replicated MySQL System

Basics of Replication • Master / Slave, Master / Master, and Circular replication • Master writes all DDL and DML statements in binary log • Slaves read the binary log and run queries locally • A master can have many slaves; a slave only one master • MySQL Replication is asynchronous

Master - Slave and Master-Master Replication Architecture • Master – Slave: Master handles writes, slave handles reads • Master – Master: Both act as master and slave for each other

Circular Replication Architecture • Multiple masters connected in a circular chain • Each master acts as a slave to the next master

Why Replication Needed • Using Replication for Backups • Different storage engines for performance • Scale-Out (Splitting load between servers) • Reporting system on slave

Types Of Replication • Synchronous Replication • Asynchronous Replication

Synchronous Replication • Master waits for data to be recorded on replicas • Two-phase commit ensures data integrity • Not implemented in MySQL

Asynchronous Replication • Write considered complete when local storage acknowledges • Performance increases, but risk of inconsistency • Slaves need not be connected permanently

Considerations Before Setting Replication • MySQL versions of servers should match • Ensure communication between master and slave

How to Set MySQL Replication 1. Configure replication user on master 2. Enable binary log and set server-id 3. Restart master 4. Take backup from master 5. Configure slave and restore backup 6. Use CHANGE MASTER and START SLAVE

Configure my.cnf Master configuration: server-id=1 log-bin=mysql-bin Slave configuration: server-id=2 relay-log=relay-bin

Configure Slave Server Use the CHANGE MASTER TO command: CHANGE MASTER TO MASTER_HOST='192.168.9.236', MASTER_USER='repl', MASTER_PASSWORD='repl@123', MASTER_LOG_FILE='mysql-bin.000004', MASTER_LOG_POS=108;

Known Issues and Resolutions • Replication can fail silently; monitor regularly • Use checksum tools (Percona) to verify tables • Compare tables and resync if needed • Monitor logs and replication lag

Thank You Prepared by: VITS Anil Questions? Feel free to reach out for clarifications.
Tags