Cluster computing with Ansible and Raspberry Pi

No readers like this yet.
Idea written in red tape

In this 25 minute video introduction, I'll walk you through the basics of Ansible using a cluster of six Raspberry Pi 2 model B computers. The video begins with the basics—like installation and telling Ansible about your servers—then shows how you can manage your infrastructure with playbooks.

I use the Raspberry Pi cluster in this video to run the website from my home, and I also use it for infrastructure testing and educational purposes.

Jeff Geerling
I'm involved in many open source development communities (like Drupal and Ansible), I'm the author of Ansible for DevOps and Ansible for Kubernetes, and I've been involved in the development of many large websites and applications.


What is the performance like with using the Raspberry Pis? Compared to a traditional desktop or desktop computer cluster?

I'm sure you can tell I am not familiar with clusters, but wonder what the performance boost is like by clustering (and whether I could use something like this to replace my own home servers ;) )

@Drew - I actually have a lot of detailed benchmarks available over on the cluster's GitHub project Wiki:…

The Pi 2 is respectable compared to a low-end PC or low-end cloud server; it is generally 20-30% slower in my testing than a micro AWS instance or a Digital Ocean droplet, but the performance difference depends on a lot of different things, especially what kind of application you run on it.

Regarding clustering in general: there's always a tradeoff to be made when clustering; you can aim for better performance and better availability, but if you want both, that requires many more servers. In this cluster, I have 6, with a load balancer, four webservers, and a database server. If the database fails, then everything is offline.

You can also add a reverse proxy so things are cached and you protect your 'backend' servers more, and you can set up the database in a master-slave configuration so you can fail over if the master goes down.

Once you get into clustering, the rabbit hole is very deep :)

In reply to by dragonbite

What clustering technology do you use to make it work? Is it Pacemaker by any chance? Sorry, CBA to watch a 25min video just to find it out :)

This is not a cluster but a group of servers on a local network. Your title is very misleading. All the same, interesting to learn about Ansible and some of it's capabilities.

It really depends on how strict a definition of cluster you mean; I intend it to mean a 'group of computers that work together to accomplish the goals of a single application'. In some places, that means all the computers work together in parallel processing a dataset. In others, that means there are different components of one large application that handle a request and serve a response (e.g. a webserver, split across multiple computers).

You have similar problems in either case—coordinating software and services across multiple servers, monitoring everything, making sure input gets routed the right way and output is successful.

Most admins I speak with use 'cluster' to refer to a number of different multi-machine scenarios, so that's how I'm using the term here.

In reply to by Rick (not verified)

What is the power supply you are using for the Pi stack?

Just for fun I discovered it seems to be easier to do any kind of web development on OSX since it is BSD underneath. What Macbook did you do your video on and is a MD101LL/A good for that? (2012 13")

Thanks John

I'm using a 2013 13" in the video, though I generally use a 2013 11" as my daily driver. (Both connected to either a 27" screen at my standing desk or a 23" screen otherwise... I only use the tiny built-in display when on the road!)

In reply to by John Jeffers P.Eng. (not verified)

Built a cluster - 6 headless RPi2's + 1 with 7" LCD for admin use.
Bought the book.
Time to play :)
Thanks for making all this information available

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.