Edited by Pyplate at Fri Nov 7, 2014 03:17 |
So far I have built a cluster of web servers, a cluster used for file storage, and a cluster of databases.
You can read about the server cluster here: http://banoffeepiserver.com/banana-pi-server-cluster/. I used Nginx on each node. Nginx doesn't handle dynamic pages, so I also set up uWSGI on each node, along with my Python CMS (www.pyplate.com). You don't have to use Nginx, I could have installed any web server. I used Apache on my Raspberry Pi cluster (http://raspberrywebserver.com/raspberrypicluster/).
When you build a web server cluster, you need to build a load-balancer to distribute HTTP requests between servers. My load balancer uses Apache in reverse proxy mode to distribute requests.
I built the next cluster using MySQL replication:http://banoffeepiserver.com/mysq ... -on-four-nodes.html. Again, there are many different databases that support replication. I chose MySQL because it's well documented and widely used.
I built a cluster using the GlusterFS distributed file system: http://banoffeepiserver.com/glus ... ana-pi-servers.html. The good thing about gluster is that if I modify a file on one node, the update will automatically be replicated on the other nodes where the file is stored. If one disk dies or a server crashes, my data is still accessible from any of the other nodes.
I used Fedora on the web server cluster, but the others are currently running Raspbian. There are 4 nodes in each cluster at the moment. The next step is to use all these clusters as one large server. The web servers will be updated so that they use the database cluster instead of an SQLite database on each server node. The web servers will use the gluster servers to store files. Offloading file storage and processing database queries from the web servers means they can run more efficiently and process more simultaneous requests.