SlideShare a Scribd company logo
Weatherly Cloud Inc. 
PHP Failover site / MySQL Failover
Index 
• What is Failover / DR / Redundant Site 
• What is Replication 
• How database replication works 
• Advantages of Replication 
• Types of Database Replications 
• How to setup replication 
• How to Monitor Replication 
• Failover Steps 
• Reverse Failover Steps
What is Failover? 
Failover is a procedure by which a system automatically transfers control to 
a duplicate system when it detects a fault or failure. A failover can be 
Automatic or Manual
What is Replication? 
Replication enables data from one server (the master) to be replicated to 
one or more servers (the slaves).
How MySQL Database 
Replication works? 
MySQL Replication is asynchronous. slaves need not be connected 
permanently to receive updates from the master. This means that updates 
can occur over long-distance connections. Depending on the configuration, 
you can replicate all databases, selected databases, or even selected tables 
within a database
Advantages of MySQL 
Database Replication 
• Scale-out solutions 
spreading the load among multiple slaves to improve performance. In this 
environment, all writes and updates must take place on the master server. 
Reads, however, may take place on one or more slaves. This model can improve 
the performance of writes (since the master is dedicated to updates), while 
dramatically increasing read speed across an increasing number of slaves. 
• Data security 
because data is replicated to the slave, and the slave can pause the replication 
process, it is possible to run backup services on the slave without corrupting the 
corresponding master data. 
• Analytics 
live data can be created on the master, while the analysis of the information 
can take place on the slave without affecting the performance of the master. 
• Long-distance data distribution 
if a branch office would like to work with a copy of your main data, you can use 
replication to create a local copy of the data for their use without requiring 
permanent access to the master.
Types of MySQL Database 
Replication 
• Unidirectional Replication 
• Bi-Directional Replication 
• Directed Replication 
• Multi Slave Replication 
• Circular Replication
Unidirectional Replication 
Data is replicated from single master to single slave server, it involves 2 
servers. This setup is usually used for backups.
Bi-Directional Replication 
This setup involves 2 servers, both being masters to the other as well as 
both being slaves to the other. This setup can be used as failover.
Multi Slave Replication 
This setup involves minimum 3 servers, “Server A” being master, “Server B” 
and “Server C” being slave to “Server A”.
Directed Replication 
This setup involves minimum 3 servers, “Server A” being master, “Server B” 
being slave to “Server A” as well as master to all other Slaves. This setup 
increases performance of “Server A”, because All slaves are directly 
connected to “Server B” and “Server A” only serves “Server B” for 
replication
Circular Replication 
This setup involves minimum 3 servers, “Server A” being master, “Server B” 
being slave to “Server A” as well as master to “Server C”, and “Server C” 
being slave to “Server B” as well as master to “Server A”
How to Setup Replication 
1. Add below directives in MySQL configuration file (my.cnf) and restart 
MySQL services 
server-id=1 
log-bin=mysql-bin 
log-error=mysql-bin.err 
2. Connect Master Server and Add Replication User (Recommended) 
3. Connect each Slave Server and execute below command 
mysql> CHANGE MASTER TO MASTER_HOST=‘master_ip', 
MASTER_USER='replication_username', MASTER_PASSWORD='replication_password‘; 
mysql> Start Slave;
How to Monitor Replication 
1. Connect to Slave Server and execute below statement to monitor status. 
mysql> Show Slave Status; 
2. Value of ‘Slave_IO_Running’ and ‘Slave_SQL_Running’ should be “YES”. 
3. If either is “No”, There are possibilities that MySQL Replication is 
broken.
Failover Steps 
If multiple slaves exists and all were configured to get updates from the “Slave A”. 
(“Slave A” is down and we are switching our updates to “Slave B”) and we have to 
configure “Slave C” to get updates from “Slave B” 
1. On all slave server(s) 
• mysql> STOP SLAVE IO_THREAD; 
• mysql> SHOW SLAVE STATUS; 
Wait for value of `Slave_IO_State` to be “Has read all relay log” 
• mysql> STOP SLAVE; 
2. On “Slave C” 
• mysql> CHANGE MASTER TO MASTER_HOST=‘SLAVE_B_IP', 
MASTER_USER=‘REPLICATION_USER', 
MASTER_PASSWORD=‘REPLICATION_PASSWORD’; 
• mysql> START SLAVE;
Reverse Failover Steps 
If your initial master server is live again and you want to make it master (may be this 
server is more powerful in aspect of computing power). You may follow below steps. 
1. On all initial master server. 
mysql> CHANGE MASTER TO MASTER_HOST=‘CURRENT_MASTER_IP', 
MASTER_USER=‘REPLICATION_USER', MASTER_PASSWORD=‘REPLICATION_PASSWORD'; 
mysql> START SLAVE; 
Wait for initial master to update it self. 
mysql> Stop Slave; 
2. Now you can follow failover steps for initial master server.
www.weatherlycloud.com 
sales@weatherlycloud.com

More Related Content

What's hot

Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
Mule database connector
Mule database connectorMule database connector
Mule database connector
Ankush Sharma
 
Mule quartz hari_gatadi
Mule quartz hari_gatadiMule quartz hari_gatadi
Mule quartz hari_gatadi
Hari Gatadi
 
Distributed Performance testing by funkload
Distributed Performance testing by funkloadDistributed Performance testing by funkload
Distributed Performance testing by funkload
Akhil Singh
 
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Jitendra Bafna
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
Anirban Sen Chowdhary
 
Mule HDFS Connector
Mule HDFS ConnectorMule HDFS Connector
Mule HDFS Connector
Ankush Sharma
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
Shanky Gupta
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
Ankush Sharma
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6
Sashidhar Rao GDS
 
Percona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
Percona and Continuent present: Multi-Data Center MySQL with Continuent TungstenPercona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
Percona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
Continuent
 
SUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDBSUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDB
MariaDB plc
 
Mule Batch Commit
Mule Batch CommitMule Batch Commit
Mule Batch Commit
Ankush Sharma
 
Multi-master, multi-region MySQL deployment in Amazon AWS
Multi-master, multi-region MySQL deployment in Amazon AWSMulti-master, multi-region MySQL deployment in Amazon AWS
Multi-master, multi-region MySQL deployment in Amazon AWS
Continuent
 
PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4
Ashnikbiz
 
Using seda in mule
Using seda in muleUsing seda in mule
Using seda in mule
Anirban Sen Chowdhary
 
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Rajni Baliyan
 
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Severalnines
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in mule
Son Nguyen
 

What's hot (19)

Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
 
Mule database connector
Mule database connectorMule database connector
Mule database connector
 
Mule quartz hari_gatadi
Mule quartz hari_gatadiMule quartz hari_gatadi
Mule quartz hari_gatadi
 
Distributed Performance testing by funkload
Distributed Performance testing by funkloadDistributed Performance testing by funkload
Distributed Performance testing by funkload
 
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Mule HDFS Connector
Mule HDFS ConnectorMule HDFS Connector
Mule HDFS Connector
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6
 
Percona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
Percona and Continuent present: Multi-Data Center MySQL with Continuent TungstenPercona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
Percona and Continuent present: Multi-Data Center MySQL with Continuent Tungsten
 
SUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDBSUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDB
 
Mule Batch Commit
Mule Batch CommitMule Batch Commit
Mule Batch Commit
 
Multi-master, multi-region MySQL deployment in Amazon AWS
Multi-master, multi-region MySQL deployment in Amazon AWSMulti-master, multi-region MySQL deployment in Amazon AWS
Multi-master, multi-region MySQL deployment in Amazon AWS
 
PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4
 
Using seda in mule
Using seda in muleUsing seda in mule
Using seda in mule
 
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
 
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in mule
 

Similar to MySqL Failover by Weatherly Cloud Computing USA

Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication BasicsAbdul Manaf
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
PoguttuezhiniVP
 
Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroup
Jayant Chutke
 
Mysql
MysqlMysql
Mysql
abhijith
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
Dave Stokes
 
Highly Available Load Balanced Galera MySql Cluster
Highly Available Load Balanced  Galera MySql ClusterHighly Available Load Balanced  Galera MySql Cluster
Highly Available Load Balanced Galera MySql Cluster
Amr Fawzy
 
Download presentation
Download presentationDownload presentation
Download presentation
Rachit Gaur
 
Download presentation531
Download presentation531Download presentation531
Download presentation531
Indra Pratap
 
Mysql S&M
Mysql S&MMysql S&M
Mysql S&M
Rob Kaufman
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High Availability
MariaDB plc
 
Database Replication
Database ReplicationDatabase Replication
Database Replication
Vatroslav Mileusnić
 
ConFoo MySQL Replication Evolution : From Simple to Group Replication
ConFoo  MySQL Replication Evolution : From Simple to Group ReplicationConFoo  MySQL Replication Evolution : From Simple to Group Replication
ConFoo MySQL Replication Evolution : From Simple to Group Replication
Dave Stokes
 
02 2017 emea_roadshow_milan_ha
02 2017 emea_roadshow_milan_ha02 2017 emea_roadshow_milan_ha
02 2017 emea_roadshow_milan_ha
mlraviol
 
Database Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David IzahkDatabase Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David Izahksqlserver.co.il
 
MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016
Dave Stokes
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
Jelastic Multi-Cloud PaaS
 
Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk
Dave Stokes
 
MariaDB High Availability Webinar
MariaDB High Availability WebinarMariaDB High Availability Webinar
MariaDB High Availability Webinar
MariaDB plc
 
Postgresql_Replication.pptx
Postgresql_Replication.pptxPostgresql_Replication.pptx
Postgresql_Replication.pptx
StephenEfange3
 

Similar to MySqL Failover by Weatherly Cloud Computing USA (20)

Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication Basics
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroup
 
Mysql
MysqlMysql
Mysql
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
Highly Available Load Balanced Galera MySql Cluster
Highly Available Load Balanced  Galera MySql ClusterHighly Available Load Balanced  Galera MySql Cluster
Highly Available Load Balanced Galera MySql Cluster
 
Download presentation
Download presentationDownload presentation
Download presentation
 
Download presentation531
Download presentation531Download presentation531
Download presentation531
 
Mysql S&M
Mysql S&MMysql S&M
Mysql S&M
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High Availability
 
Database Replication
Database ReplicationDatabase Replication
Database Replication
 
ConFoo MySQL Replication Evolution : From Simple to Group Replication
ConFoo  MySQL Replication Evolution : From Simple to Group ReplicationConFoo  MySQL Replication Evolution : From Simple to Group Replication
ConFoo MySQL Replication Evolution : From Simple to Group Replication
 
02 2017 emea_roadshow_milan_ha
02 2017 emea_roadshow_milan_ha02 2017 emea_roadshow_milan_ha
02 2017 emea_roadshow_milan_ha
 
Database Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David IzahkDatabase Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David Izahk
 
MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
 
Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk
 
MariaDB High Availability Webinar
MariaDB High Availability WebinarMariaDB High Availability Webinar
MariaDB High Availability Webinar
 
Postgresql_Replication.pptx
Postgresql_Replication.pptxPostgresql_Replication.pptx
Postgresql_Replication.pptx
 

Recently uploaded

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

MySqL Failover by Weatherly Cloud Computing USA

  • 1. Weatherly Cloud Inc. PHP Failover site / MySQL Failover
  • 2. Index • What is Failover / DR / Redundant Site • What is Replication • How database replication works • Advantages of Replication • Types of Database Replications • How to setup replication • How to Monitor Replication • Failover Steps • Reverse Failover Steps
  • 3. What is Failover? Failover is a procedure by which a system automatically transfers control to a duplicate system when it detects a fault or failure. A failover can be Automatic or Manual
  • 4. What is Replication? Replication enables data from one server (the master) to be replicated to one or more servers (the slaves).
  • 5. How MySQL Database Replication works? MySQL Replication is asynchronous. slaves need not be connected permanently to receive updates from the master. This means that updates can occur over long-distance connections. Depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database
  • 6. Advantages of MySQL Database Replication • Scale-out solutions spreading the load among multiple slaves to improve performance. In this environment, all writes and updates must take place on the master server. Reads, however, may take place on one or more slaves. This model can improve the performance of writes (since the master is dedicated to updates), while dramatically increasing read speed across an increasing number of slaves. • Data security because data is replicated to the slave, and the slave can pause the replication process, it is possible to run backup services on the slave without corrupting the corresponding master data. • Analytics live data can be created on the master, while the analysis of the information can take place on the slave without affecting the performance of the master. • Long-distance data distribution if a branch office would like to work with a copy of your main data, you can use replication to create a local copy of the data for their use without requiring permanent access to the master.
  • 7. Types of MySQL Database Replication • Unidirectional Replication • Bi-Directional Replication • Directed Replication • Multi Slave Replication • Circular Replication
  • 8. Unidirectional Replication Data is replicated from single master to single slave server, it involves 2 servers. This setup is usually used for backups.
  • 9. Bi-Directional Replication This setup involves 2 servers, both being masters to the other as well as both being slaves to the other. This setup can be used as failover.
  • 10. Multi Slave Replication This setup involves minimum 3 servers, “Server A” being master, “Server B” and “Server C” being slave to “Server A”.
  • 11. Directed Replication This setup involves minimum 3 servers, “Server A” being master, “Server B” being slave to “Server A” as well as master to all other Slaves. This setup increases performance of “Server A”, because All slaves are directly connected to “Server B” and “Server A” only serves “Server B” for replication
  • 12. Circular Replication This setup involves minimum 3 servers, “Server A” being master, “Server B” being slave to “Server A” as well as master to “Server C”, and “Server C” being slave to “Server B” as well as master to “Server A”
  • 13. How to Setup Replication 1. Add below directives in MySQL configuration file (my.cnf) and restart MySQL services server-id=1 log-bin=mysql-bin log-error=mysql-bin.err 2. Connect Master Server and Add Replication User (Recommended) 3. Connect each Slave Server and execute below command mysql> CHANGE MASTER TO MASTER_HOST=‘master_ip', MASTER_USER='replication_username', MASTER_PASSWORD='replication_password‘; mysql> Start Slave;
  • 14. How to Monitor Replication 1. Connect to Slave Server and execute below statement to monitor status. mysql> Show Slave Status; 2. Value of ‘Slave_IO_Running’ and ‘Slave_SQL_Running’ should be “YES”. 3. If either is “No”, There are possibilities that MySQL Replication is broken.
  • 15. Failover Steps If multiple slaves exists and all were configured to get updates from the “Slave A”. (“Slave A” is down and we are switching our updates to “Slave B”) and we have to configure “Slave C” to get updates from “Slave B” 1. On all slave server(s) • mysql> STOP SLAVE IO_THREAD; • mysql> SHOW SLAVE STATUS; Wait for value of `Slave_IO_State` to be “Has read all relay log” • mysql> STOP SLAVE; 2. On “Slave C” • mysql> CHANGE MASTER TO MASTER_HOST=‘SLAVE_B_IP', MASTER_USER=‘REPLICATION_USER', MASTER_PASSWORD=‘REPLICATION_PASSWORD’; • mysql> START SLAVE;
  • 16. Reverse Failover Steps If your initial master server is live again and you want to make it master (may be this server is more powerful in aspect of computing power). You may follow below steps. 1. On all initial master server. mysql> CHANGE MASTER TO MASTER_HOST=‘CURRENT_MASTER_IP', MASTER_USER=‘REPLICATION_USER', MASTER_PASSWORD=‘REPLICATION_PASSWORD'; mysql> START SLAVE; Wait for initial master to update it self. mysql> Stop Slave; 2. Now you can follow failover steps for initial master server.