From owner-freebsd-isp@FreeBSD.ORG Sat Apr 10 10:09:37 2004 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 693B016A4CE for ; Sat, 10 Apr 2004 10:09:37 -0700 (PDT) Received: from mail.lambertfam.org (www.lambertfam.org [216.223.208.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D0AB43D2F for ; Sat, 10 Apr 2004 10:09:37 -0700 (PDT) (envelope-from lambert@lambertfam.org) Received: from localhost (localhost [127.0.0.1]) by mail.lambertfam.org (Postfix) with ESMTP id 40C8834D66 for ; Sat, 10 Apr 2004 13:09:34 -0400 (EDT) Received: from mail.lambertfam.org ([127.0.0.1]) by localhost (www.lambertfam.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 92393-04 for ; Sat, 10 Apr 2004 13:09:26 -0400 (EDT) Received: from laptop.lambertfam.org (cdm-66-233-132-205.rsvl.cox-internet.com [66.233.132.205]) by mail.lambertfam.org (Postfix) with ESMTP id 0FCD934D64 for ; Sat, 10 Apr 2004 13:09:26 -0400 (EDT) Received: by laptop.lambertfam.org (Postfix, from userid 1001) id D83BBC0E6; Sat, 10 Apr 2004 13:09:24 -0400 (EDT) Date: Sat, 10 Apr 2004 13:09:24 -0400 From: Scott Lambert To: freebsd-isp@freebsd.org Message-ID: <20040410170924.GA15943@laptop.lambertfam.org> Mail-Followup-To: freebsd-isp@freebsd.org References: <7E8A3A1C-8AA0-11D8-B20E-003065A9024A@ish.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7E8A3A1C-8AA0-11D8-B20E-003065A9024A@ish.com.au> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at lambertfam.org Subject: Re: synchronising failover web servers X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2004 17:09:37 -0000 On Sat, Apr 10, 2004 at 01:38:12PM +1000, Aristedes Maniatis wrote: > The problems we have right now are: > > 1. how to sync the html directories > 2. how to sync config files (eg httpd.conf, contents of /usr/local/etc, > and so on) > > I have been experimenting with various options. For (2), I have been > thinking of creating a cvs repository to which we commit all changes > and then creating cvs checkout scripts on the deployment machines. That > way rollback is easy, we can comment changes, and testing on a third > testing box is easy. However, cvs is not well suited to files scattered > all over a file system. It expects to deal with a single folder full of > files and folders. One word "Makefiles". :-) I have a lot of system configs in cvs. Eventually I'll have all of them. Each subsystem config has it's own directory and I have Makefiles setup to work the subdirs where necessary. We check the configs out in our home directories on each machine and run : $ make update install [test] [restart] The Makefiles take care of su'ing where necessary. The test and restart targets are used where appropriate. Test does things like "apachectl graceful", "nagios -v nagios.cfg", "spamassassin --lint", .... I try to make sure restart depends on the test target but I still explicitly use test on the command line. I have a lot of other convenience targets for things like setting up the bind chroot environment, downloading addon rule sets for SpamAssassin, running sdiff on the KERNCONF files, diffing the installed configs with the cvs'd configs in case someone does things to the live configs and forgets to commit to CVS. The bind configs include a script which I add to cron to update themselves. Other often changing configs are the same way. Yet other less redundant/scarier downtime consequence configs have to be updated and installed manually. I have a "dist" target to ssh to a list of machines to run the make line on each. But there is a human watching for errors. The better the Makefile, the easier the building of a new machine. I'm still learning better ways to do things with make. -- Scott Lambert KC5MLE Unix SysAdmin lambert@lambertfam.org http://www.lambertfam.org/~lambert/resume.html