IT automation with Ansible on a cluster of 6 Raspberry Pi computers

Cluster computing with Ansible and Raspberry Pi

Posted 03 Feb 2016 by 

up
56 readers like this
Cluster computing with Ansible and Raspberry Pi
Image by : 

opensource.com

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 www.pidramble.com from my home, and I also use it for infrastructure testing and educational purposes.

10 Comments

dragonbite

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

Vote up!
1
Vote down!
0
geerlingguy

@Drew - I actually have a lot of detailed benchmarks available over on the cluster's GitHub project Wiki: https://github.com/geerlingguy/raspberry-pi-dramble/wiki/Dramble-D8-Benc...

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

Vote up!
0
Vote down!
0
Tomas

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

Vote up!
0
Vote down!
0
Rick

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.

Vote up!
0
Vote down!
0
geerlingguy

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.

Vote up!
0
Vote down!
0
rpehlm

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

Vote up!
0
Vote down!
0
geerlingguy

The entire parts list is available on the Raspberry Pi Dramble Wiki: http://www.pidramble.com/wiki/hardware/pis

I'm using a 6-port USB desktop charger (has 6 USB ports delivering at least 1A each, plugs into AC mains power), but I'll soon be switching to a dedicated 5V power supply that feeds into the GPIO headers directly.

Vote up!
0
Vote down!
0
John Jeffers P.Eng.

Jeff
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

Vote up!
0
Vote down!
0
geerlingguy

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

Vote up!
0
Vote down!
0
rpehlm

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

Vote up!
1
Vote down!
0
Jeff Geerling

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