SlideShare una empresa de Scribd logo
1 de 33
Reliable MySQL Using Replication Issac Goldstand Mirimar Networks www.mirimar.net [email_address]
What is replication? ,[object Object],[object Object],[object Object],[object Object]
Replication basics… ,[object Object],[object Object],[object Object],Master Slave Slave Slave Slaves
Replication basics… ,[object Object],[object Object],[object Object],DATA DATA INSERT INTO … Master Slave Client
Replication basics… ,[object Object],[object Object],DATA DATA INSERT INTO … Binary Log Master Slave Client
Replication basics… ,[object Object],[object Object],[object Object],DATA DATA INSERT INTO … INSERT INTO … Relay Log Replication Thread Master Slave Client
Replication basics… ,[object Object],[object Object],DATA DATA INSERT INTO … INSERT INTO … Relay Log Replication Thread DATA Master Slave Client
Replication Strategies ,[object Object],Master Slave Slave Slave Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT) Client (INSERT)
Replication Strategies ,[object Object],[object Object],MySQL Server MySQL Server MySQL Server Client INSERT INTO… INSERT INTO … Client
Replication Strategies ,[object Object],[object Object],[object Object],DATA DATA DATA DATA DATA Client Master Slave
Replication Strategies ,[object Object],[object Object],[object Object],[object Object],Master Slave Backup with LOCK TABLES (or single transaction) Client INSERT / SELECT Client INSERT / SELECT
Simple Replication Setup ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Configure master my.cnf ------------- [mysqld] server-id = 1 log-bin
Configure slave my.cnf ------------- [mysqld] server-id = 2 master-user = someuser master-password = secret master-host = ip.of.master
Initial dataset ,[object Object],[object Object],[object Object],[object Object]
Configure log position MASTER mysql> SHOW MASTER STATUS; +---------------------------+----------+--------------+------------------+ | File  | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------------------+----------+--------------+------------------+ |  vmware-mirimar-bin.000002  |  79  |  |  | +---------------------------+----------+--------------+------------------+ SLAVE mysql> CHANGE MASTER TO MASTER_LOG_FILE=‘ vmware-mirimar-bin.000002 ’, MASTER_LOG_POS= 79 ; SLAVE mysql> START SLAVE;
Using CHANGE MASTER TO ,[object Object],[object Object],[object Object],[object Object],[object Object]
Advanced CHANGE MASTER TO ,[object Object],[object Object],[object Object],[object Object],[object Object]
Confirming it works SLAVE mysql> SHOW SLAVE STATUS *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host:  vmware-mirimar Master_User:  someuser Master_Port: 3306 Connect_Retry: 60 Master_Log_File:  vmware-mirimar-bin.000002 Read_Master_Log_Pos:  79 Relay_Log_File: vmware1-mirimar-relay-bin.000002 Relay_Log_Pos: 250 Relay_Master_Log_File: vmware-mirimar-bin.000002 Slave_IO_Running:  Yes Slave_SQL_Running:  Yes Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 79 Relay_Log_Space: 250 Seconds_Behind_Master:  0
Permissions ,[object Object],[object Object]
Internal Threads ,[object Object],[object Object],[object Object]
IO thread isolation ,[object Object],[object Object]
SQL thread isolation ,[object Object],[object Object],[object Object]
Master Thread ,[object Object],[object Object],[object Object]
Status files ,[object Object],[object Object],[object Object],[object Object]
Information in master.info ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Information in relay-log.info ,[object Object],[object Object],[object Object],[object Object]
Backup master ,[object Object],[object Object],[object Object],[object Object]
Backup master files ,[object Object],[object Object],[object Object],[object Object]
Backup slave ,[object Object],[object Object],[object Object]
Live demo ,[object Object]
For more information ,[object Object],[object Object],[object Object]
Thank You! For more information: Issac Goldstand margol@mirimar.net http://www.beamartyr.net/ http://www.mirimar.net/

Más contenido relacionado

Destacado

Lengua y literatura tercero
Lengua y literatura terceroLengua y literatura tercero
Lengua y literatura tercero
Alfredo Vera
 
Market Research Report : Power backup market in india 2013
Market Research Report : Power backup market in india 2013Market Research Report : Power backup market in india 2013
Market Research Report : Power backup market in india 2013
Netscribes, Inc.
 
Windows 8 vs windows 7 ppt
Windows 8 vs windows 7 pptWindows 8 vs windows 7 ppt
Windows 8 vs windows 7 ppt
Diya Mirza
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
Tehmina Gulfam
 
Thalassemia dr.k.v.giridhar
Thalassemia dr.k.v.giridharThalassemia dr.k.v.giridhar
Thalassemia dr.k.v.giridhar
giridharkv
 
01 microsoft office word 2007 (introduction and parts)
01 microsoft office word 2007 (introduction and parts)01 microsoft office word 2007 (introduction and parts)
01 microsoft office word 2007 (introduction and parts)
benchhood
 

Destacado (20)

What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginn...
 
Lengua y literatura tercero
Lengua y literatura terceroLengua y literatura tercero
Lengua y literatura tercero
 
Endapan Placer
Endapan PlacerEndapan Placer
Endapan Placer
 
Presentation deduplication backup software and system
Presentation   deduplication backup software and systemPresentation   deduplication backup software and system
Presentation deduplication backup software and system
 
Market Research Report : Power backup market in india 2013
Market Research Report : Power backup market in india 2013Market Research Report : Power backup market in india 2013
Market Research Report : Power backup market in india 2013
 
Windows 10 deployment training for system builders
Windows 10 deployment training for system buildersWindows 10 deployment training for system builders
Windows 10 deployment training for system builders
 
Lesson 5 ms office word 2007
Lesson 5   ms office word 2007Lesson 5   ms office word 2007
Lesson 5 ms office word 2007
 
Windows 10 VDI Migration in real life - E2EVC Rome
Windows 10 VDI Migration in real life - E2EVC RomeWindows 10 VDI Migration in real life - E2EVC Rome
Windows 10 VDI Migration in real life - E2EVC Rome
 
Windows 8 vs windows 7 ppt
Windows 8 vs windows 7 pptWindows 8 vs windows 7 ppt
Windows 8 vs windows 7 ppt
 
Comparison of Windows 7 & Windows 8
Comparison of Windows 7 & Windows 8Comparison of Windows 7 & Windows 8
Comparison of Windows 7 & Windows 8
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
 
Thalassemia dr.k.v.giridhar
Thalassemia dr.k.v.giridharThalassemia dr.k.v.giridhar
Thalassemia dr.k.v.giridhar
 
Chemistry Investigatory Project Class 12 - Green Chemistry - Bio Diesel And B...
Chemistry Investigatory Project Class 12 - Green Chemistry - Bio Diesel And B...Chemistry Investigatory Project Class 12 - Green Chemistry - Bio Diesel And B...
Chemistry Investigatory Project Class 12 - Green Chemistry - Bio Diesel And B...
 
Thalassemia
ThalassemiaThalassemia
Thalassemia
 
thalassemia
thalassemiathalassemia
thalassemia
 
Introduction to microsoft word 2007
Introduction to microsoft word 2007Introduction to microsoft word 2007
Introduction to microsoft word 2007
 
01 microsoft office word 2007 (introduction and parts)
01 microsoft office word 2007 (introduction and parts)01 microsoft office word 2007 (introduction and parts)
01 microsoft office word 2007 (introduction and parts)
 
Windows 10
Windows 10Windows 10
Windows 10
 
Thalassemia
ThalassemiaThalassemia
Thalassemia
 
Chemistry Investigatory Project (Class 12 ,CBSE)
Chemistry Investigatory Project (Class 12 ,CBSE)  Chemistry Investigatory Project (Class 12 ,CBSE)
Chemistry Investigatory Project (Class 12 ,CBSE)
 

Similar a Download presentation

Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
Vasudeva Rao
 
2012 replication
2012 replication2012 replication
2012 replication
sqlhjalp
 
Replication tutorial presentation
Replication tutorial presentationReplication tutorial presentation
Replication tutorial presentation
colderboy17
 

Similar a Download presentation (20)

Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroup
 
Download presentation
Download presentationDownload presentation
Download presentation
 
Download presentation531
Download presentation531Download presentation531
Download presentation531
 
Mysql
MysqlMysql
Mysql
 
MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016
 
MySQL Replication Basics -Ohio Linux Fest 2016
MySQL Replication Basics -Ohio Linux Fest 2016MySQL Replication Basics -Ohio Linux Fest 2016
MySQL Replication Basics -Ohio Linux Fest 2016
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
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
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
8.replication
8.replication8.replication
8.replication
 
2012 scale replication
2012 scale replication2012 scale replication
2012 scale replication
 
Mysql S&M
Mysql S&MMysql S&M
Mysql S&M
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
2012 replication
2012 replication2012 replication
2012 replication
 
Performence tuning
Performence tuningPerformence tuning
Performence tuning
 
Replication tutorial presentation
Replication tutorial presentationReplication tutorial presentation
Replication tutorial presentation
 

Más de webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
webhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
webhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
webhostingguy
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
webhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
webhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
webhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
webhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
webhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
webhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
webhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
webhostingguy
 

Más de webhostingguy (20)

File Upload
File UploadFile Upload
File Upload
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 

Download presentation

  • 1. Reliable MySQL Using Replication Issac Goldstand Mirimar Networks www.mirimar.net [email_address]
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Configure master my.cnf ------------- [mysqld] server-id = 1 log-bin
  • 14. Configure slave my.cnf ------------- [mysqld] server-id = 2 master-user = someuser master-password = secret master-host = ip.of.master
  • 15.
  • 16. Configure log position MASTER mysql> SHOW MASTER STATUS; +---------------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------------------+----------+--------------+------------------+ | vmware-mirimar-bin.000002 | 79 | | | +---------------------------+----------+--------------+------------------+ SLAVE mysql> CHANGE MASTER TO MASTER_LOG_FILE=‘ vmware-mirimar-bin.000002 ’, MASTER_LOG_POS= 79 ; SLAVE mysql> START SLAVE;
  • 17.
  • 18.
  • 19. Confirming it works SLAVE mysql> SHOW SLAVE STATUS *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: vmware-mirimar Master_User: someuser Master_Port: 3306 Connect_Retry: 60 Master_Log_File: vmware-mirimar-bin.000002 Read_Master_Log_Pos: 79 Relay_Log_File: vmware1-mirimar-relay-bin.000002 Relay_Log_Pos: 250 Relay_Master_Log_File: vmware-mirimar-bin.000002 Slave_IO_Running: Yes Slave_SQL_Running: Yes Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 79 Relay_Log_Space: 250 Seconds_Behind_Master: 0
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Thank You! For more information: Issac Goldstand margol@mirimar.net http://www.beamartyr.net/ http://www.mirimar.net/