17 Aug 2013

ELB Failover for AWS hosted Percona XtraDB Cluster

The previous post - AWS Load Balancing for the Percona XtraDB Cluster - gave an overview of Percona Cluster (PXC) config in AWS for a VPC hosted (balanced) application. This supplemental post provides an added level of granularity by adding redundancy (failover) for the Elastic Load Balancers (ELBs).
We will implement primary and secondary ELBs with configured health checks under AWS Route 53 DNS along with advisories for phpmyadmin access via the ELB DNS alias.

As before lets take a look at the schematic first (Fig:1), followed by an explanation of what's going on.


So, what do we have here. Well, as in the previous post our PXC is configured with IOPS optimised EC2s spread over x3 zones. A x3 (AWS) zone, datacentre or 'switch' minimum configuration is strongly advised to prevent a 'split brain' situation in the event of node connectivity issues, although an 'arbitrator' instance can be utilised for x2 nodes where a x3 node config is not possible. In this expanded configuration we have x2 ELBs configured identically (with the same port listeners/health checks etc) although for resilience they should be placed in alternate zones

Cluster nodes and ELBs are running in their own respective security groups (SGs) with relevant port/IP and/or top level SG access between both granted and locked down where required. The 'magic' is taken care of in Route 53 using failover (health check) aliases for primary and secondary ELBs (Fig:2). Simply choose 'Failover' as the Routing Policy and create matched (primary and secondary) entries for both ELBs. Job done.


As previously mentioned, in order to utilise phpmyadmin via the ELB DNS alias you will need to configure relevant ELB port pass through (80) along with load balancer generated session cookies set with a suitable expiry time, and you will (obviously) need to install phpmyadmin to each node.

If you would like advice or assistance with Percona XtraDB clustering, or any other aspects of AWS IaaS and HA systems feel free to get in touch, we would be more than happy to hook up and discuss how Cirronix can help you design and deliver your cloud infrastructure - http://cirronix.com/contact


Anonymous said...

Can you please let us know how can we configure 3 servers percona extra DB cluster under LB.

What settings will we required?


RichBos said...

Hi Ashok, sure thing, we would be more than happy to advise you on the config. If you would like to contact us directly we offer an affordable range of consultancy and infrastructure development services with no-contract fixed price support slots from 1 hour upwards.


Best regards

Rich B

Post a Comment