drbdlinks is a program that will manage creation and removal of symbolic links. It is primarily used with clusters of machines using either shared storage or the "DRBD" replicated block device. It has the ability to fix SELinux contexts and restart cron and syslog as part of the linking process.
While the name of the program is "drbdlinks", it can be used in any shared-storage sort of environment where the shared storage is only mounted on the active node. In cases like NFS where the shared storage is always mounted on all nodes, drbdlinks is not necessary.
The advantage over creating static symbolic links is that package updates often require that directories point at real files, so updates can often fail if you do not have the shared storage mounted.
drbdlinks also supports multiple instances of links, in the case of active/active clusters. For example, if you have MySQL running in one resource group, and Apache running in another, you can use the "-c" switch to specify a configuration file for each resource group.
A simple configuration file, "/etc/drbdlinks.conf", specifies the links. This can be used to manage links for /etc/httpd, /var/lib/pgsql, and other system directories that need to appear as if they are local to the system when running applications after a drbd shared partition has been mounted.
When run with "start" as the mode, drbdlinks will rename the existing files/directories, and then make symbolic links into the DRBD partition. "stop" does the reverse. By default, the rename appends ".drbdlinks" to the name, but this can be overridden.
An init script is included which runs "stop" before heartbeat starts, and after heartbeat stops. This is done to try to ensure that when the shared partition isn't mounted, the links are in their normal state.
Python: a current version (2.0+) to work. You can get source (and binaries for selected systems) from www.python.org.
Here is a simple configuration file:
mountpoint('/shared') link('/home/') link('/etc/httpd') link('/var/log/httpd', '/shared/logs/httpd')
In this example, we are mounting the DRBD partition in "/shared", and by default we are causing "/home" to be linked to "/shared/home", "/etc/httpd" to "/shared/etc/httpd", etc... The last line shows an example of a link which specifies the destination location explicitly, instead of assuming that it goes to the same location under shared.
DRBDLinks is released under the GPL version 2.
DRBDLinks (source, binaries, report formats, documentation and all related matter) is copyright © 2004-2013 Sean Reifschneider, tummy.com, ltd.