Saturday, February 9, 2013 - Khan Kennels › presentations › pdf ›...
Transcript of Saturday, February 9, 2013 - Khan Kennels › presentations › pdf ›...
![Page 1: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/1.jpg)
1
Saturday, February 9, 2013
![Page 2: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/2.jpg)
<Insert Picture Here>
Replication With MySQLLigaya Turmelle Principle Technical Support Engineer - MySQL https://joind.in/8017
Saturday, February 9, 2013
![Page 3: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/3.jpg)
3
<Insert Picture Here>
[email protected] Support Engineer
MySQL ACE~8 years
@lig
About Me
Saturday, February 9, 2013
![Page 4: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/4.jpg)
4
TODO List
• Foundation• Overview• Asynchronous and Semi-Synchronous• Setup• Monitoring
Saturday, February 9, 2013
![Page 5: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/5.jpg)
5
Foundation
Saturday, February 9, 2013
![Page 6: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/6.jpg)
6
Baby Steps
Network
Saturday, February 9, 2013
![Page 7: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/7.jpg)
7
Why would you want to do that?
Saturday, February 9, 2013
![Page 8: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/8.jpg)
• Scale Out
8
Why would you want to do that?
Saturday, February 9, 2013
![Page 9: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/9.jpg)
• Scale Out• Data Redundancy
9
Why would you want to do that?
Saturday, February 9, 2013
![Page 10: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/10.jpg)
• Scale Out• Data Redundancy• Analytics
10
Why would you want to do that?
Saturday, February 9, 2013
![Page 11: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/11.jpg)
• Scale Out• Data Redundancy• Analytics• Long distance data distribution
11
Why would you want to do that?
Saturday, February 9, 2013
![Page 12: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/12.jpg)
<Insert Picture Here>
12
MySQL Terminology
Saturday, February 9, 2013
![Page 13: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/13.jpg)
• Method of Sending the Data
13
Terminology
Saturday, February 9, 2013
![Page 14: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/14.jpg)
• Method of Sending the Data• Asynchronous Replication - since 3.23
14
Terminology
Saturday, February 9, 2013
![Page 15: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/15.jpg)
• Method of Sending the Data• Asynchronous Replication - since 3.23• Semi-Synchronous Replication - 5.5+
15
Terminology
Saturday, February 9, 2013
![Page 16: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/16.jpg)
• Where to Store the Changes
16
Terminology
Saturday, February 9, 2013
![Page 17: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/17.jpg)
• Where to Store the Changes• Binary Log - Master
17
Terminology
Saturday, February 9, 2013
![Page 18: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/18.jpg)
• Where to Store the Changes• Binary Log - Master• Relay Log - Slave
18
Terminology
Saturday, February 9, 2013
![Page 19: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/19.jpg)
• Method of Replication
19
Terminology
Saturday, February 9, 2013
![Page 20: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/20.jpg)
• Method of Replication• SBR - Statement Based Replication
20
Terminology
Saturday, February 9, 2013
![Page 21: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/21.jpg)
• Method of Replication• SBR - Statement Based Replication• RBR - Row Based Replication
21
Terminology
Saturday, February 9, 2013
![Page 22: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/22.jpg)
• Method of Replication• SBR - Statement Based Replication• RBR - Row Based Replication• Mixed Mode
• http://dev.mysql.com/doc/refman/5.5/en/binary-log-mixed.html
22
Terminology
Saturday, February 9, 2013
![Page 23: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/23.jpg)
• Replication Threads
23
Terminology
Saturday, February 9, 2013
![Page 24: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/24.jpg)
• Replication Threads • Slave Server
• IO Thread
24
Terminology
Saturday, February 9, 2013
![Page 25: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/25.jpg)
• Replication Threads • Slave Server
• IO Thread• SQL Thread
25
Terminology
Saturday, February 9, 2013
![Page 26: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/26.jpg)
• Replication Threads • Master Server
• Binlog Dump Thread
26
Terminology
Saturday, February 9, 2013
![Page 27: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/27.jpg)
27
Overviews
Saturday, February 9, 2013
![Page 28: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/28.jpg)
<Insert Picture Here>
28
MySQL Replication
Saturday, February 9, 2013
![Page 29: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/29.jpg)
29
Highlevel Replication Overview
1Master
Saturday, February 9, 2013
![Page 30: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/30.jpg)
30
Highlevel Replication Overview
Binarylog
1
2
Master
Saturday, February 9, 2013
![Page 31: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/31.jpg)
31
Highlevel Replication Overview
RelayLog
Binarylog
1
3
2
Master
Saturday, February 9, 2013
![Page 32: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/32.jpg)
32
Highlevel Replication Overview
Slave
RelayLog
Binarylog
1
4
3
2
Master
Saturday, February 9, 2013
![Page 33: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/33.jpg)
33
Asynchronous vsSemi-Synchronous
Saturday, February 9, 2013
![Page 34: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/34.jpg)
<Insert Picture Here>
34
Asynchronous Replication
Saturday, February 9, 2013
![Page 35: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/35.jpg)
35
Asynchronous
Master Slave
Saturday, February 9, 2013
![Page 36: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/36.jpg)
36
Asynchronous
Master SlaveIO Thread (3)
Binlog DumpThread created
Saturday, February 9, 2013
![Page 37: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/37.jpg)
37
Asynchronous
Master Slave
Binarylog
IO Thread (3)
Binlog DumpProcess
Saturday, February 9, 2013
![Page 38: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/38.jpg)
38
Asynchronous
Master Slave
RelayLog
Binarylog
IO Thread (3)
Binlog DumpProcess
IO Thread (3)
Saturday, February 9, 2013
![Page 39: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/39.jpg)
• Pros• Fast• slave can be disconnected
• Cons• Potential loss of transactions and data integrity
39
Asynchronous
Saturday, February 9, 2013
![Page 40: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/40.jpg)
<Insert Picture Here>
40
Semi-Synchronous Replication
Saturday, February 9, 2013
![Page 41: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/41.jpg)
41
Semi-Synchronous
Master Slave
semi-synccapable
semi-synccapable
Saturday, February 9, 2013
![Page 42: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/42.jpg)
42
Semi-Synchronous
Master SlaveIO Thread (3)
Binlog DumpThread created
semi-sync capablesemi-synccapable
semi-synccapable
Saturday, February 9, 2013
![Page 43: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/43.jpg)
43
Semi-Synchronous(optimal)
Saturday, February 9, 2013
![Page 44: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/44.jpg)
44
Semi-Synchronous(optimal)
Master SlaveIO Thread
Binlog DumpThreadCreated
semi-synccapable
semi-synccapable
1
Saturday, February 9, 2013
![Page 45: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/45.jpg)
45
Semi-Synchronous(optimal)
Master Slave
RelayLog
Binarylog
IO Thread
Binlog DumpProcess
IO Thread (save)
semi-synccapable
semi-synccapable
1
x
Saturday, February 9, 2013
![Page 46: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/46.jpg)
46
Semi-Synchronous(optimal)
Master SlaveIO Thread semi-synccapable
semi-synccapable
1
RelayLog
Binarylog
Binlog DumpProcess
IO Thread (ack)
Saturday, February 9, 2013
![Page 47: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/47.jpg)
47
Semi-Synchronous(timeout)
Saturday, February 9, 2013
![Page 48: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/48.jpg)
48
Semi-Synchronous(timeout)
Master SlaveIO Thread
Binlog DumpThreadCreated
semi-synccapable
semi-synccapable
1
Saturday, February 9, 2013
![Page 49: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/49.jpg)
49
Semi-Synchronous(timeout)
Master Slave
Binarylog
IO Thread
Binlog DumpProcess
semi-synccapable IO Thread (save)
semi-synccapable
1
xNetwork
Saturday, February 9, 2013
![Page 50: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/50.jpg)
50
Semi-Synchronous(timeout)
Master Slave
Binarylog
IO Thread
Binlog DumpProcess
semi-synccapable IO Thread (save)
semi-synccapable
1
xNetwork
TIMEOUT
Saturday, February 9, 2013
![Page 51: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/51.jpg)
51
Semi-Synchronous(timeout)
Master Slave
Binarylog
IO Thread
Binlog DumpProcess
async semi-synccapable
1
Saturday, February 9, 2013
![Page 52: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/52.jpg)
52
Semi-Synchronous(timeout)
Master Slave
RelayLog
Binarylog
IO Thread
Binlog DumpProcess
IO Thread (save)
async semi-synccapable
Saturday, February 9, 2013
![Page 53: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/53.jpg)
53
Semi-Synchronous(timeout)
Master Slave
RelayLog
Binarylog
IO Thread
Binlog DumpProcess
IO Thread (save)
async semi-synccapable
resync
Saturday, February 9, 2013
![Page 54: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/54.jpg)
54
Semi-Synchronous(timeout)
Master Slave
RelayLog
Binarylog
IO Thread (synced)
Binlog DumpProcess
async semi-synccapable
resync
Saturday, February 9, 2013
![Page 55: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/55.jpg)
55
Semi-Synchronous(timeout)
Master Slave
RelayLog
Binarylog
Binlog DumpProcess
semi-synccapable
IO Thread semi-synccapable
Saturday, February 9, 2013
![Page 56: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/56.jpg)
• Pros• Tries to improve data integrity
• Cons• Performance Implications
56
Semi-Synchronous
Saturday, February 9, 2013
![Page 57: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/57.jpg)
57
Setting it Up
Saturday, February 9, 2013
![Page 58: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/58.jpg)
<Insert Picture Here>
58
Asynchronous -Master
Saturday, February 9, 2013
![Page 59: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/59.jpg)
• Config/Option file• my.cnf/my.ini
59
Asynchronous - Master
log-bin=mysql_binserver_id=1
Saturday, February 9, 2013
![Page 60: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/60.jpg)
60
Asynchronous - Mastermysql> CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%.mydomain.com';
• Create replication user• requires
REPLICATION SLAVE privilege
Saturday, February 9, 2013
![Page 61: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/61.jpg)
61
Asynchronous - Mastermysql> FLUSH TABLES WITH READ LOCK;
mysql> SHOW MASTER STATUS; • Master server binary log coordinates• requires
REPLICATION SLAVE privilege
Saturday, February 9, 2013
![Page 62: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/62.jpg)
• While the tables are locked• if you need a copy of the master, this is the time to make it
• Once you have a copy, release the locks
62
Asynchronous - Master
mysql> UNLOCK TABLES;
Saturday, February 9, 2013
![Page 63: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/63.jpg)
<Insert Picture Here>
63
Asynchronous -Slave
Saturday, February 9, 2013
![Page 64: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/64.jpg)
• Config/Option file• my.cnf/my.ini
64
Asynchronous - Slave
server_id=2read-only
Saturday, February 9, 2013
![Page 65: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/65.jpg)
• Load in the copy/backup from the master• always verify that the backup works
65
Asynchronous - Slave
Saturday, February 9, 2013
![Page 66: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/66.jpg)
66
Asynchronous - Slavemysql> CHANGE MASTER TO
MASTER_HOST = 'master.mycompany.com', MASTER_USER = 'repl', MASTER_PASSWORD='slavepass', MASTER_PORT=3306, MASTER_LOG_FILE='master-bin. 001', MASTER_LOG_POS=4;
mysql> START SLAVE;
• Issue CHANGE MASTER command• info from MASTER
STATUS
Saturday, February 9, 2013
![Page 67: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/67.jpg)
<Insert Picture Here>
67
Semi-Synchronous -Master
Saturday, February 9, 2013
![Page 68: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/68.jpg)
68
Semi-Synchronous - Mastermysql> INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
mysql> SHOW PLUGINS;• Install PLUGIN
• Server must support dynamic loading (see have_dynamic_loading)
Saturday, February 9, 2013
![Page 69: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/69.jpg)
69
Semi-Synchronous - Mastermysql> SET GLOBAL rpl_semi_sync_master_enabled = 1;
mysql> SET GLOBAL rpl_semi_sync_master_timeout = N;
• Enable PLUGIN• default is off
Saturday, February 9, 2013
![Page 70: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/70.jpg)
• Config/Option file• my.cnf/my.ini
70
Semi-Synchronous - Master
log-bin=mysql_binserver_id=1
# semi-sync replrpl_semi_sync_master_enabled = 1rpl_semi_sync_master_timeout = 1000 # 1 sec
Saturday, February 9, 2013
![Page 71: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/71.jpg)
<Insert Picture Here>
71
Semi-Synchronous -Slave
Saturday, February 9, 2013
![Page 72: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/72.jpg)
72
Semi-Synchronous - Slavemysql> INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
mysql> SHOW PLUGINS;• Install PLUGIN
• Server must support dynamic loading (see have_dynamic_loading)
Saturday, February 9, 2013
![Page 73: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/73.jpg)
73
Semi-Synchronous - Slavemysql> SET GLOBAL rpl_semi_sync_slave_enabled = 1;
• Enable PLUGIN• Default is Off
Saturday, February 9, 2013
![Page 74: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/74.jpg)
74
Semi-Synchronous - Slavemysql> STOP SLAVE IO_THREAD;
mysql> START SLAVE IO THREAD;• Runtime
Saturday, February 9, 2013
![Page 75: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/75.jpg)
• Config/Option file• my.cnf/my.ini
75
Semi-Synchronous - Slave
server_id=2read-only
# semi-sync replrpl_semi_sync_slave_enabled=1
Saturday, February 9, 2013
![Page 76: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/76.jpg)
76
Monitoring
Saturday, February 9, 2013
![Page 77: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/77.jpg)
<Insert Picture Here>
77
Monitoring -Master
Saturday, February 9, 2013
![Page 78: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/78.jpg)
• Gives file name and position• Lists filtering done on Master
78
Master Status
mysql> SHOW MASTER STATUS;+---------------+----------+--------------+------------------+| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |+---------------+----------+--------------+------------------+| mysql-bin.003 | 73 | test | manual,mysql |+---------------+----------+--------------+------------------+
Saturday, February 9, 2013
![Page 79: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/79.jpg)
• Gives the binary logs on the server
79
Binary Logs
mysql> SHOW BINARY LOGS;+---------------+-----------+| Log_name | File_size |+---------------+-----------+| binlog.000015 | 724935 || binlog.000016 | 733481 |+---------------+-----------+
Saturday, February 9, 2013
![Page 80: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/80.jpg)
<Insert Picture Here>
80
Monitoring -Slave
Saturday, February 9, 2013
![Page 81: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/81.jpg)
81
Slave Statusmysql> SHOW SLAVE STATUS\G*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: root Master_Port: 3306 Connect_Retry: 3 Master_Log_File: mysql-bin.003 Read_Master_Log_Pos: 73 Relay_Log_File: mysql-relay-bin.005 Relay_Log_Pos: 548 Relay_Master_Log_File: mysql-bin.003 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table:
Saturday, February 9, 2013
![Page 82: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/82.jpg)
82
Slave Status Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 73 Relay_Log_Space: 552 Until_Condition: None Until_Log_File: Last_SQL_Error: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 8Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error:
Saturday, February 9, 2013
![Page 83: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/83.jpg)
• State Slave_IO_State: Waiting for master to send event
• Running Slave_IO_Running: Yes
Slave_SQL_Running: Yes
• Last Error Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error:
83
Slave Status - Basic Stuff
Saturday, February 9, 2013
![Page 84: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/84.jpg)
• Where everything is• IO Thread
Master_Log_File: mysql-bin.003 Read_Master_Log_Pos: 73
84
Slave Status - Important Stuff
Saturday, February 9, 2013
![Page 85: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/85.jpg)
• Where everything is• SQL Thread
• Relay Log Relay_Log_File: mysql-relay-bin.005 Relay_Log_Pos: 548
• Binary Log Relay_Master_Log_File: mysql-bin.003 .... Exec_Master_Log_Pos: 73
85
Slave Status - Important Stuff
Saturday, February 9, 2013
![Page 86: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/86.jpg)
• Show Caution
Seconds_Behind_Master: 8
86
Slave Status - Caution
Saturday, February 9, 2013
![Page 87: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/87.jpg)
• Lot of changes• Global Transaction ID• Binary Log Group Commit• Parallel execution of transactions on the slave• Crash-safe Replication• And more
87
MySQL 5.6
Saturday, February 9, 2013
![Page 88: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/88.jpg)
88
Questions?
Saturday, February 9, 2013
![Page 89: Saturday, February 9, 2013 - Khan Kennels › presentations › pdf › replication_ssphp.pdfReplication With MySQL Ligaya Turmelle Principle Technical Support Engineer - MySQL Saturday,](https://reader033.fdocuments.net/reader033/viewer/2022053018/5f1d1276cc84136b1e7d2705/html5/thumbnails/89.jpg)
89
Saturday, February 9, 2013