Keeping your Varnish farms configuration in sync

I spend some of my free time helping out with server administration and programming for the Swedish Pirate Party, Piratpartiet (look ma, X-Varnish), and we use Varnish for our caches. At the moment it’s just used on some of our projects, but we’re going to migrate most of our projects to be behind our Varnish caches.

The thing is though that we got two hosts running the exact same configuration, and we’d like to keep those hosts in sync. A quick search on Google gave me nothing for syncing varnish configuration over several hosts, or a farm as it were. So I took matters into my own hands and wrote varnishsync, a little bash script that uses rsync and ssh to sync the configuration folder and then to load and use the new configuration.

Please have a look at the Github project for the latest version and usage, and if you’ve any questions or suggestions drop a line here or on Github.

Posted 02:21 January 7th, 2011 by Björn Andersson in English posts.
Tagged: , , , .
  • Pingback: Tweets that mention Keeping your Varnish farm in sync – corner of ramblings --

  • yggdrasil

    Many people use configuration management software for this, such as Puppet or Chef. They’re not specific to Varnish but used for managing all kinds of packages and configuration-files, which is probably why your Google search didn’t turn up a Varnish-specific solution.

    My company’s tool-of-choice is Puppet. We use it both to initially set up a server from scratch and to repeatedly (every 30min) keep the configuration in sync with the desired state. Works very well for Varnish.

    • gaqzi

      You’re very correct, at the point in time when I wrote this I wasn’t aware of those tools and now I use Chef for managing my servers. :)

      • yggdrasil

        Good job! I realized it was an older article and thought it was smart to mention current tooling in case people come looking for advice. :)