Top Banner
www.mydbops.com [email protected] Presenter Karthik P R CEO Mydbops Percona XtraDB Cluster Ensure High Availability
35

Percona XtraDB Cluster ( Ensure high Availability )

Jan 22, 2018

Download

Engineering

MyDBOPS
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Percona XtraDB Cluster ( Ensure high Availability )

www.mydbops.com [email protected]

Presenter

Karthik P R CEO Mydbops

Percona XtraDB ClusterEnsure High Availability

Page 2: Percona XtraDB Cluster ( Ensure high Availability )

Mydbops is into MySQL/MongoDB Support and Consulting. It is founded by experts who have scaled database at Yahoo! ,Percona and Datavail. We are providing an expert level support and 24*7 monitoring for MySQL databases and its related technologies like MariaDB , Percona ( also clustering ) . We support modern database technologies in MySQL which includes Galera ( Clustering ), Group Replication , SQL aware Load balancers like Maxscale / ProxySQL.

Mydbops

Page 3: Percona XtraDB Cluster ( Ensure high Availability )

www.mydbops.com [email protected]

Our Clients

Page 4: Percona XtraDB Cluster ( Ensure high Availability )

CEO / DB Architect

About Me

Page 5: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 6: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 7: Percona XtraDB Cluster ( Ensure high Availability )

• One of Best Feature in MySQL from start.

• Asynchronous in nature.

• Binary log based replication.

• Data is streamed between nodes.

• Works irrespective of MySQL Engine used.

Native MySQL Replication

Page 8: Percona XtraDB Cluster ( Ensure high Availability )

• Can have any kind of topology and any levels

Native MySQL Replication

Page 9: Percona XtraDB Cluster ( Ensure high Availability )

• Slaves helps in the read scalability.

○ Asynchronous Replication ( lag )

○ Data loss and data inconsistency

○ Parallelism.

■ 5.6 = Database level

■ 5.7 = Time based group

■ 8.0 = Writeset ( RC )

Native MySQL Replication

Page 10: Percona XtraDB Cluster ( Ensure high Availability )

• Replication Switchover and Failover

○ Externals scripts for failover.

○ GTID 5.6 and Orchestrator makes things better.

• Adding a slave (node)

○ Backup and restore.

○ Manual config of slave coordinates.

Native MySQL Replication

Page 11: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 12: Percona XtraDB Cluster ( Ensure high Availability )

Percona XtraDB Cluster is an active/active high availability and high scalability open source solution for MySQL.Percona XtraDB Cluster 5.7 is MySQL 5.7 compatible Galera-based high availability (HA) solution.

Tightly integrated with Xtrabackup and ProxySQL for scalability. Heavily tested for production workload and has a huge share in MySQL clustering solution & Openstack for RDBMS.

Percona XtraDB Cluster

Page 13: Percona XtraDB Cluster ( Ensure high Availability )

What is Galera ?

Galera is a replication plugin for the synchronous replication and multi master replication to achieve High Availability. The read and writes can be made on any node and there is no complex failover solutions. An open source from codership team.

What is wsrep ?

WSREP (Write Set REPlication) is an API to connect the Galera library and control the characteristics of Galera.It helps to implement the Certificate based replication and multi master replication.

Percona XtraDB Cluster

Page 14: Percona XtraDB Cluster ( Ensure high Availability )

Features

● Synchronous Replication ( Virtually )

● Parallel applier threads

● Quorum based

● Automatic node provisioning

● Multi master writes

● PXC Specific features

Percona XtraDB Cluster

Page 15: Percona XtraDB Cluster ( Ensure high Availability )

Transaction in Galera

Percona XtraDB Cluster

Page 16: Percona XtraDB Cluster ( Ensure high Availability )

Transaction in Galera

Percona XtraDB Cluster

Page 17: Percona XtraDB Cluster ( Ensure high Availability )

Percona XtraDB Cluster - Setup

Group Communication

Percona XtraDB Cluster

Page 18: Percona XtraDB Cluster ( Ensure high Availability )

Parallel Appliers

● Write set consists only rows to replicate.

● Any transaction which writes different tuples can be parallelized.

● wsrep_slave_threads controls parallel threads

Percona XtraDB Cluster

Application Writes Replication Writes

Page 19: Percona XtraDB Cluster ( Ensure high Availability )

Percona XtraDB Cluster

Recovery

IST(Incremental State

Transfer)

SST(State Snapshot

Transfer)

● Disconnected for maintenance

● Node crashed

● Joining a new node

● Node disconnected for a long time

Page 20: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 21: Percona XtraDB Cluster ( Ensure high Availability )

● Improved scalability by 10x.

● Tracking IST Progress

● Gcache Recovery

● PXC_Strict_mode

● Performance Schema for Galera

● Securing PXC

What is new in XtraDB Cluster ?

Page 22: Percona XtraDB Cluster ( Ensure high Availability )

What is new in XtraDB Cluster ?Improved XtraDB Cluster Scalability

Page 23: Percona XtraDB Cluster ( Ensure high Availability )

What is new in XtraDB Cluster ?IST Improvements

Page 24: Percona XtraDB Cluster ( Ensure high Availability )

● Gcache Recovery ( Codership )

Gcache can be made to disk with gcache.recover=yes it helps in restoring cache on restore.It saves pains in SST.

● PXC_strict_mode

PXC Strict Mode is designed to avoid the use of experimental and unsupported features in Percona XtraDB Cluster. It includes storage engine checks, Primary key checks, binlog format , Autoinc lock mode and others.

What is new in XtraDB Cluster ?

Page 25: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 26: Percona XtraDB Cluster ( Ensure high Availability )

● Load balancer for MySQL

○ HAProxy ( TCP Layer )

○ Maxscale ( Application Layer )

○ ProxySQL ( Application Layer )

● SQL aware load balancer (application layer) , forward the queries/statements by

understanding the underlying state of PXC.

○ Read-write split up

○ Automatic Switchover

Load Balancing

Page 27: Percona XtraDB Cluster ( Ensure high Availability )

● ProxySQL is light weight

● Build by René Cannaò

● GPL V3 License

● SQL based administration

● Custom cluster health check script

● Proxysql-admin for easy configuration.

● ProxySQL 1.4 comes with inbuilt clustering

Load Balancing ( ProxySQL )

Page 28: Percona XtraDB Cluster ( Ensure high Availability )

● Maxscale Build by MariaDB

● File based config

● Pluggable Router

● GPL and BSL model

○ Maxscale 1.4 (GPL)

○ Maxscale 2.X (BSL)

Load Balancing ( Maxscale )

Page 29: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 30: Percona XtraDB Cluster ( Ensure high Availability )

● High Availability

○ Quorum

○ Automated Failover

● Read Scaling ( No write scaling )

○ No read-write split required

○ Read throughput increased with nodes

● WAN Based Replication.

○ Optimized WAN segments

Use cases

Page 31: Percona XtraDB Cluster ( Ensure high Availability )

Sample Architecture ( 3 node + 2 node ProxySQL )

Use cases

Page 32: Percona XtraDB Cluster ( Ensure high Availability )

1. Native MySQL Replication

2. Percona XtraDB Cluster

3. What is new in XtraDB Cluster ?

4. Load Balancing

5. Use Cases

6. Limitations

Table of Contents

Page 33: Percona XtraDB Cluster ( Ensure high Availability )

● Supports Only InnoDB Engine.

● Tables should have Primary Key ( else created internally )

● All nodes should have same capacity.

● Avoid heavier and longer transaction ( OLTP workload )

● Schema changes are costly ( use pt-osc )

● Needs a Stable and strong network.

Limitations

Page 34: Percona XtraDB Cluster ( Ensure high Availability )

● Percona XtraDB Cluster Official website

○ https://www.percona.com/doc/percona-xtradb-cluster/

● Percona XtraDB Blogs

○ https://www.percona.com/blog/category/percona-xtradb-cluster/

Resources

Page 35: Percona XtraDB Cluster ( Ensure high Availability )

www.mydbops.com [email protected]

Contact US:

Write to me at [email protected]

DB Consulting Contact : [email protected]

Phone : 08048505683