ioguix' README

24 January 2019 comment

Build a PostreSQL Automated Failover in 5 minutes

I’ve been working with Vagrant to quickly build a fresh test cluster for PAF development. Combined with virsh snapshot related commands, I save a lot of time during my tons of tests by quickly rollbacking the whole cluster to the initial state.

I thought the result might be useful for people who want to challenge such a cluster, without all the burden of building it and setting everything up. The Vagrantfile and related files has been pushed to the official PAF repository. Just look at the test/ file there for complete instructions:

After very short and easy prerequisites, you’ll be able to build a fresh and ready cluster with one command and a cup of coffee. It takes about 4 minutes on my laptop to complete, from creating four new empty VMs to watching at the full cluster status.

And for the busiest of you that want to see it in action, here is a screencast1 (about 4 minutes, 7’30” in real speed). It starts on a virgin fedora 29, all prerequisites and setup are covered, from scratch to a running virtualized demo cluster:

Once you have a running cluster, you can connect to the virtual machines using vagrant ssh <nodename>. By default, nodes are srv1, srv2, svr3 and log-sink. This last node collect all logs from the cluster nodes and report them in /var/log/messages and /var/log/<nodename>/.

And if you want some examples about how to exercise the cluster, look at this other screencast (5’32, normal speed):

If you want to go deeper with PAF, don’t forget to read our documentation with attention. HA is not a matter of some commands copy/pasted from internet. It requires some time, documentation crawling and lot of tests. HINT: write docs and procedures, lots of them, and keep them up to date!


  1. I use asciinema. For keyboard shortcuts, see

Comments Leave a comment by email or Disqus

Note: I only publish your name/pseudo, mail subject and content. I will NOT publish your email address.

No comments yet.