This post is a step-by-step guide to set up Percona XtraDB
Cluster (PXC) in a virtualized test sandbox. I used Amazon EC2
micro instances, but the content here is applicable for any kind
of virtualization technology (for example VirtualBox). The goal
is to give step by step instructions, so the setup process is
understandable and it could serve as a reference architecture.
You will need 4 virtual machines. 3 for PXC and 1 for the client,
which will have HaProxy. I used CentOS 6 as the operating system,
the instructions are similar for any Linux distribution.
The client node will have HaProxy installed and it will redirect
requests to PXC nodes. This approach works well in real-world
scenarios too. Running HaProxy on the application servers instead
of having them as dedicated entities gives you benefits like you
don’t need an extra network roundtrip because of a loadbalancer
and scalability of PXC’s load balancing layer scales …
[Read more]