percona xtradb cluster ( ensure high availability )

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

Upload: mydbops

Post on 22-Jan-2018

352 views

Category:

Engineering


4 download

TRANSCRIPT

www.mydbops.com [email protected]

Presenter

Karthik P R CEO Mydbops

Percona XtraDB ClusterEnsure 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

www.mydbops.com [email protected]

Our Clients

CEO / DB Architect

About Me

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

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

• 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

• Can have any kind of topology and any levels

Native MySQL Replication

• 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

• 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

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

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

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

Features

● Synchronous Replication ( Virtually )

● Parallel applier threads

● Quorum based

● Automatic node provisioning

● Multi master writes

● PXC Specific features

Percona XtraDB Cluster

Transaction in Galera

Percona XtraDB Cluster

Transaction in Galera

Percona XtraDB Cluster

Percona XtraDB Cluster - Setup

Group Communication

Percona XtraDB Cluster

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

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

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

● Improved scalability by 10x.

● Tracking IST Progress

● Gcache Recovery

● PXC_Strict_mode

● Performance Schema for Galera

● Securing PXC

What is new in XtraDB Cluster ?

What is new in XtraDB Cluster ?Improved XtraDB Cluster Scalability

What is new in XtraDB Cluster ?IST Improvements

● 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 ?

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

● 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

● 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 )

● Maxscale Build by MariaDB

● File based config

● Pluggable Router

● GPL and BSL model

○ Maxscale 1.4 (GPL)

○ Maxscale 2.X (BSL)

Load Balancing ( Maxscale )

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

● 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

Sample Architecture ( 3 node + 2 node ProxySQL )

Use cases

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

● 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

● 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

www.mydbops.com [email protected]

Contact US:

Write to me at [email protected]

DB Consulting Contact : [email protected]

Phone : 08048505683