|
The term "Hot Backup" refers to temporarily taking a system offline to get the data into a consistent state, then making a backup, and then bringing
the system back online. While the system is down for backup, some access to the data remains available (although this access may be read-only or in some
other way limited).
The problem with any backup strategy is this: what happens if the data changes as you are backing it up? To take a relevant Discus example, assume you
are in the middle of taking a board backup, and then someone posts a message. You may have already backed up the posting logs, but you have not yet
backed up the page where the message was added. The posting logs change when the message is posted. Eventually your backup gets around to the page where
the message was added. In your backup, your posting logs contain no data about the post, whereas the post is stored on the message page. This is what is
meant by "inconsistent state."
The easiest way to ensure that a Discus backup will not be in an "inconsistent state" is to put your board into Maintenance Mode prior to taking any
backup. Maintenance mode disables any "write" operations (except by the board administrator). This specifically prevents posting, logins, and the like.
However, it still allows your visitors to read messages on the board, thus preserving some accessibility and qualifying (according to our definition) as
a "hot backup."
Of course, when your board is in Maintenance Mode, nobody can post, so you want to minimize the amount of time that the board is in Maintenance Mode.
To do this, the creation of your backup should occur as quickly as possible.
The mirroring solution
DiscusWare has a recommended "hot backup" solution that will ensure backups of your discussion board that are reliable and stable, while at the same
time minimizing the downtime for the discussion board system as the backup is created. Even very large discussion boards can be backed up in this way in
just a few minutes, sometimes even less.
The first time you do this, create a separate directory structure that mirrors your discussion board. This will be a second copy of your discussion
board data, and can be on the same server or a different server. For greatest speed it should be on the same server. We will call this the "mirror copy"
(begging indulgence here from system administrators to whom "mirror" means something completely different).
The normal operation of the board's backups are then:
-
Put the board into Maintenance Mode to ensure that no posting activity will take place.
-
Copy the discussion board files from the discussion board's directories into the mirror copy. For greatest efficiency this is done with "rsync" (a
unix utility that compares files in two locations and copies the file only if there is a change). On the assumption that only a small percentage of
the files will actually change, using "rsync" is a significant speedup versus having to copy all of the files.
-
Take the board out of maintenance mode.
-
Use "tar" or some other method to make a backup of the mirror copy.
The step that will take the greatest amount of time is the final one - creating the actual backup. However, by synchronizing the discussion board to
its mirror, and then backing up the mirror, there is no requirement that the discussion board itself be down while the backup is taken! A similar
strategy (albeit with methods more sophistocated than "rsync") is commonly used to create hot backups of databases and other mission-critical
systems.
There is one caveat to the above procedure - this will double the amount of disk space that your board requires. However, if your board is critical,
the importance of good backups may outweigh the relatively inexpensive disk space needed for this strategy.
Implementation
DiscusWare publishes the above information in hopes that it will be useful. Unix system administrators may already be familiar with "rsync" and
perhaps the information above will be useful to them. Note that DiscusWare does NOT support this procedure.
DiscusWare offers consulting on backup strategy and implementation through its custom programming services. We have successfully implemented this
strategy for various customers, and we use it with our own systems. For some customers, we even automatically download a copy of their data to our
servers, or transfer it somewhere else on the internet, providing a complete solution. For more information about DiscusWare's custom programming
services, please visit this page on our web site.
|