Fun Experiment: G3 on Multiple Servers Behind Load Balancer

jasonvp
jasonvp's picture

Joined: 2002-09-27
Posts: 19
Posted: Fri, 2011-02-11 02:42

I have a machine here at home that runs VMWare's ESXi hypervisor. On that I have a number of Linux VMs as well as a Solaris 11 Express one. I've installed Gallery 3 on one of the LAMP servers as well as the SAMP server. They both NFS-mount the same NAS, and I logically linked each Gallery 3's var directory to that NAS.

The next step was to connect to one of the servers, in this case the LAMP, and configure Gallery 3. The database was set up, the password set, etc, etc. Once that was completed, I told G3 to migrate all of my G2 photos over. After that, I enabled Dan's most excellent S3 module; shortly thereafter the photos and videos were sync'd to Amazon.

Since the SAMP server had the same var linked to the NAS, when I connected to its Gallery instance, it was all ready configured and ready to go. That was easy!

Final step: put them behind the load balancer. The F5 LB has a Web-based UI so you can point, click, and grunt your way through the configuration. I set it up to round-robin equally between the LAMP and SAMP servers; both their IPv4 and v6 addresses. Health checking was set to just GET a small, empty file. If the server returns anything other than "200" on that GET, the load balancer will drop it out of rotation. Now I can easily take one out of rotation without ever logging into the LB again just by deleting that file.

Testing: upload a new album. Sure enough, it worked fine. After it was uploaded, my cron job kicked in to S3-sync, and voila, the album was on S3.

There isn't much here (yet), but http://gallery.lateapex.net

Fun stuff.

jas