Geographically Dispersed Percona XtraDB Cluster Deployment
Marco (the Grinch) Tusa September 2017 Dublin
Geographically Dispersed Percona XtraDB Cluster Deployment Marco - - PowerPoint PPT Presentation
Geographically Dispersed Percona XtraDB Cluster Deployment Marco (the Grinch) Tusa September 2017 Dublin About me Marco The Grinch Open source enthusiast Percona consulting Team Leader 2 Agenda What is PXC When nodes
Geographically Dispersed Percona XtraDB Cluster Deployment
Marco (the Grinch) Tusa September 2017 Dublin
2
Marco “The Grinch”
3
4
(Virtually) Synchronous Replication:
Galera Balancer Web traffic
5
Not Write-scalable solution Not great for a high amount of parallel, small requests Not great for working with Foreign Keys Not good for sharding Data (each node has the entire dataset)
Galera Balancer Web traffic
6
Standard MySQL Replication
Master Slave Slave
Node Node Node
9cba28fa-a8be-11e4-8f41-9f963e1dbf4f
7
A segment is a logical grouping of nodes. Replication between Segment is
communication)
Traffic and messaging is reduced In case of SST, the donor is chosen by proximity
8
Use a two phase commit, or distributed locking with capacity formula: m = n x o x t (where messages/sec = number of nodes due to process o number of
throughput)
9
10
Geo dispersed
system and application availability in the event of site disaster. In this configuration, servers are separated geographically and the physical storage (quorum diskor) DATA is synchronously replicated between sites.
(http://www.expertglossary.com/storage/definition/geo-dispersed-cluster)
11
For some environments, latency is the sole focus of performance. As an example of latency, shows a network transfer, such as an HTTP GET request, with the time split into latency and data transfer components.
12
Geo dispersed is determinate by the latency existing between nodes NOT by the geographic location itself.
13
(It measures latency from the time point when a message is sent out to the time point when a message is received.)
14
14
14
14
15
Ref: https://goo.gl/kDTYnW
15
Ref: https://goo.gl/kDTYnW
15
Ref: https://goo.gl/kDTYnW
16
16
16
ping -M do -s 1473 -c 3 192.168.0.34
16
ping -M do -s 1473 -c 3 192.168.0.34
16
17
17
TCP means Transmission Control Protocol and as the name says, it is design to control the data transmission happening between source and destination. TCP implementations use the IP protocol encapsulation for the transmission of the data:
17
TCP means Transmission Control Protocol and as the name says, it is design to control the data transmission happening between source and destination. TCP implementations use the IP protocol encapsulation for the transmission of the data:
17
TCP means Transmission Control Protocol and as the name says, it is design to control the data transmission happening between source and destination. TCP implementations use the IP protocol encapsulation for the transmission of the data:
Looks the same thing than before right?
17
TCP means Transmission Control Protocol and as the name says, it is design to control the data transmission happening between source and destination. TCP implementations use the IP protocol encapsulation for the transmission of the data:
Looks the same thing than before right?
18
A TCP implementation has several characteristics that make sense to summarize:
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection Monitor the data transfer
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection Monitor the data transfer Buffered transmission
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection Monitor the data transfer Buffered transmission Unstructured stream
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection Monitor the data transfer Buffered transmission Unstructured stream Full-duplex connection
18
A TCP implementation has several characteristics that make sense to summarize: Is stream oriented Establish a connection Monitor the data transfer Buffered transmission Unstructured stream Full-duplex connection Stream as a sequence of octet split in segments
19
TCP dispatcher use Dynamic Slide Window
19
TCP dispatcher use Dynamic Slide Window
19
TCP dispatcher use Dynamic Slide Window Dispatcher manages three pointers associated to each connection: The first pointer indicate the start of the sliding window The second pointer indicates the higher octet that can be dispatchtet. The third pointer indicates the window limit
20
Back to us
20
Back to us
20
Back to us
bytes)
20
Back to us
bytes)
20
Back to us
bytes)
20
Back to us
bytes)
21
22
Wan settings:
22
Wan settings:
evs.inactive_check_period = PT30S; evs.inactive_timeout = PT1M; evs.suspect_timeout = PT40S; evs.stats_report_period = PT3M; evs.join_retrans_period=PT0.5S don’t use PING
22
Wan settings:
evs.inactive_check_period = PT30S; evs.inactive_timeout = PT1M; evs.suspect_timeout = PT40S; evs.stats_report_period = PT3M; evs.join_retrans_period=PT0.5S don’t use PING
Master_Slave not a very good option though
wsrep_provider_options = "gcs.fc_limit = 256; gcs.fc_factor = 0.99; gcs.fc_master_slave = YES"
23
We can use almost the same models we used
23
We can use almost the same models we used Challenge is to shift from one Master-Node to a new one Or from a slave to another
24
Standard binlog position using XID and wsrep_last_committed
+----------------------+---------+ | Variable_name | Value | +----------------------+---------+ | wsrep_last_committed | 3282552 | +----------------------+---------+
Binlog
# at 544 #170920 19:26:56 server id 3306 end_log_pos 575 CRC32 0x3ae1edcd Xid = 3282552
Simple to install/setup Nightmare to maintain
25
Using GTID All nodes on a cluster will have the same GTID Move from a slave from one node to another can be automated. Existing: Yves Trudeau solution : https://github.com/y-trudeau/Mysql-tools/tree/master/PXC Single link DC1->DC2 Multiple Link DC1 -> DC2 ->DC3
26
Conclusions
PXCs
27
28
Q&A
29
Contacts
To contact Me Marco.tusa@percona.com marcotusa@tusacentral.net To follow me http://www.tusacentral.net/ http://www.percona.com/blog/ https://www.facebook.com/marco.tusa.94 @marcotusa http://it.linkedin.com/in/marcotusa/
“Consulting = No mission refused!”