I have been playing with backup software to determine a good way of backing up my servers; other than the unorigional tar and scp method I have been using until now.
I did investigate TSM server/client (tested with a version 5.x) but while that was easier to install and get working initially, errors like recovery logs running out of space, database file running out of space etc, with all the solutions easily found via google, made me realise I didn’t want a product where so many people keep hitting the same problems. Also another main reason was after looking at setting up schedules for TSM I realised why there are dedicated storage administrators, too complicated. Didn’t even attempt to try to define tapes to it. And of course it’s commercial.
Instead I had a look at the Bacula application, while a little harder to setup initially (actually it is easier to setup, but working on instructions from multiple websites makes it difficult to follow, just needs one master setup document) it seems to meet my needs perfectly; and is installable via rpm from the Fedora repositories. So this post is about bacula.
The main issues I had with setting up Bacula all now resolved (using MySQL as the database, using rpms from Fedora) were
- the supplied MySQL table creation script needed editing, a one line change, “MaxValue INTEGER DEFAULT 0,” became “`MaxValue` INTEGER DEFAULT 0,” (backquote around MaxValue); I guess MaxValue became a MySQL reserved word at some point
- firewall rules of course, I opened up the ports for the server to contact the clients, didn’t realise the clients needed to be able to connect back to the server storage task as well for a backup to work
- figuring out how the passwords between the different components worked; it actually makes perfect sense once figured out
- schedules. Not really an issue, the default samples are enough to get multiple servers backed up using the default schedule, BUT using the default schedule for each server meant the FULL backups for every server were run on the same day. I should have thought of that. Created seven new schedules, each doing a full backup on a seperate day of the week, and split the servers amoungst those schedules
Configuration is simple, on each client (and the server as you want to back that up as well) just customise /etc/bacula/bacula-fd.conf to know about the server, and on the server customise /etc/bacula/bacula-sd.conf (to define disk and tape storage) plus /etc/bacula/bacula-dir.conf to define the backup clients (the fd instances), backup schedules and backup jobs, leave the default restore job as is. Then start bacula-fd on each client, and bacula-sd plus bacula-dir on the backup server, and watch it all just work.
I used an external 1TB drive formatted as ext4 as a dedicated Bacula file storage device. Also it was easy to configure the storage task to access the virtual tape changer and tape devices provided by the MHVTL virtual tape library package, although I haven’t actually got around to doing backups backups to those virtual tape devices yet (seeing as how its a bit pointless as they are just disk files that would need backing up again).
I have only used the two main user interfaces so far, both do everything I have needed to this point. The first id the bat gui interface (screenshot below) which is the easiest way to display if backup jobs worked/failed and manually rerun if needed plus also delete MySQL backup entries for an entire job if needed (for the failed ones). The second is the command line bconsole interface which is the best for restoring files, displaying upcoming schedules, and will show the same messages being written to the logs as would appear in the logs (backup success/failure/filecounts etc).
All if my servers are now being backed up by Bacula (full, incremental and differential backups) on manageable schedules, and individual file restores have been tested.
And it is a lot easier to restore files than from my older tar solution, which I may shortly retire when I get Bacula backup failures reported to my own alert monitoring solution.
It will not replace my semi-regular Clonezilla backups however, Clonezilla still seems the best option for bare metal server recovery; but Bacula will certainly make ad-hoc individual file restores easier.
Update 2011/10/26: hmm, I changed the config and it only does full backups now. Stopped all services and dropped the dbs and recreated it, plus deleted everything under /var/spool/bacula, same issue. Put back the origional config and repeated deleting everything, same issue. Somehow I have disabled differential and incremental backups even for the origionally working config; messages mumble something about no suitable full backup found. Well I don’t have enough space for a full backup to be done every day and kept for two months, so it’s not as user friendly as I thought. Oh well, plug away. Retaining my old backup method in parallel for now as I will have to delete the bacula file storage every 8-9 days if this keeps up.
Update 2011/12/14 – went back to the origional config and forced a full backup on the days I wanted it to repeat on, which works. Don’t use differential anymore… still using bacula.