Metadata Mirroring¶
Warning
Mirroring is not a replacement for backups. If files are accidentally deleted or overwritten by a user or process, mirroring won’t help you to bring the old file back. So you are still responsible to do regular backups of your important bits.
Activating Metadata Mirroring¶
After metadata server buddy groups have been defined as described under Management of Mirror Buddy Groups, metadata mirroring can be activated on the file system.
Warning
When applying the beegfs mirror init
command, no clients may be mounted. This can be achieved
by stopping the beegfs-client service beforehand, and starting it again after beegfs mirror
init
was successfully performed. In addition, please restart the beegfs-meta service on all
nodes afterward.
To activate metadata mirroring, use the beegfs
tool:
$ beegfs mirror init
In order to synchronize all information across the various components of BeeGFS correctly, the clients can not be mounted during this process, and the metadata servers must be restarted afterwards.
The full series of steps in an already running system is:
Stop all clients, do not stop any metadata servers.
Execute
beegfs mirror init
Restart all metadata servers
Start all clients.
Running this command will enable metadata mirroring for the root directory of the BeeGFS, as well as all the files contained in it. Note that existing directories except for the root directory will not be mirrored automatically. Please see Migrating Existing Metadata below to find out how to mirror existing directories.
New files and directories created inside a directory with active metadata mirroring will also have
metadata mirroring activated. There might be situations where it is desirable to deactivate metadata
mirroring for part of the file systems. This gives a slight performance boost, but the data will not
be preserved in the event of a server failure. A directory without metadata mirroring can be created
using beegfs
:
$ beegfs entry create directory --no-mirror <name>
For information about additional command line parameters refer to the built-in --help
.
Directories and files created inside a directory without metadata mirroring will have metadata mirroring disabled.
Migrating Existing Metadata¶
If a file is moved into a directory with active metadata mirroring, it will have its metadata mirrored. On the other hand, directories will not automatically be mirrored when moved. For a directory to be mirrored, it is therefore necessary to freshly create a directory inside a mirrored directory. The easiest way to enable mirroring for a whole directory tree is to do a recursive copy:
$ cp -a <directory> <mirrored-dir>
This will also copy the file contents, therefore it is possible to use it for enabling metadata and storage mirroring at the same time.