SIOS introduced the Distributed Replicated Block Device (DRBD) Recovery Kit in SIOS LifeKeeper for Linux version 9.9.0. Migrating from SIOS DataKeeper for Linux to DRBD is a simple process for those who want to experiment with DRBD features within LifeKeeper as well as for those who were previously more acquainted with DRBD.
Understanding DRBD and Its Benefits in LifeKeeper
DRBD is a software-based, shared-nothing, replicated storage solution mirroring the content of block devices (hard disks, partitions, logical volumes, etc.) between hosts. The LifeKeeper for Linux DRBD Recovery Kit provides the ability to configure and control DRBD resources for high availabilty.
Comparing SIOS DataKeeper for Linux and DRBD
SIOS DataKeeper for Linux provides an integrated data mirroring capability for LifeKeeper environments. It’s an alternative for customers who want to build a high availability cluster (using SIOS LifeKeeper) without shared storage or who simply want to replicate business-critical data in real-time between servers.
SIOS DataKeeper provides synchronous or asynchronous volume-level mirroring to replicate data from the primary server (mirror source) to one or more backup servers (mirror targets).Steps for creating your PostgreSQL resource are excluded from this blog, but more information on configuring PostgreSQL with SIOS LifeKeeper can be found here.
How to Migrate Your PostgreSQL Database to DRBD
- Stop the PostgreSQL application via the LifeKeeper UI
lkcli resource remove –tag pgsql-demo
- Create a backup of the data for the PostgreSQL database and log files
cp -pra /pgsql-demo* /backup/
- Create a new DRBD resource with a temporary file system location.
lkcli resource create drbd –tag drbd-pgsql-demo –device /dev/mapper/singledrbd-lk1 –fstype ext3 –mount_point /tmp/pgsql-demo
Be sure to select the same fstype as the previous DataKeeper for Linux resource. The devices selected should also be sufficient for the amount of data and logs for the PostgreSQL database datasets.
- Extend the DRBD resource to the target server.
lkcli resource extend drbd –tag drbd-pgsql-demo –dest node-a –device /dev/xvdc3 –mode synchronous –laddr 10.15.29.165 –raddr 10.15.27.49
- Take the file system resource for the PostgreSQL database out of service.
lkcli resource remove –tag /pgsql-demo
- Change the owner and group for the /tmp/pgsql/demo directories.
chown postgres:postgres /tmp/pgsql/demo
- Copy the data to the DRBD mirrored file system.
cp -pra /backup/* /tmp/pgsql-demo
- Take the newly created DRBD file system resource out of service.
lkcli resource remove –tag /tmp/pgsql-demo
- Break the dependency between the previous file system and the DataKeeper for Linux resource
lkcli dependency delete –parent /pgsql-demo –child datarep-pgsql-demo
Break the dependency between the file system and the DRBD resource.
lkcli dependency delete –parent /tmp/pgsql-demo –child drbd-pgsql-demo
- Recreate the dependency between the existing /pgsql-demo file system and the drbd resource
lkcli dependency create –parent /pgsql-demo –child drbd-pgsql-demo
- Start the pgsql-demo resource
lkcli resource restore –tag pgsql-demo
BEGIN restore of “pgsql-demo” on server “node-b”
waiting for server to start…. done
server started
END successful restore of “pgsql-demo” on server “node-b”
- Connect to the database and verify the database connection.
For example:
psql -p 3308 -h /pgsql-demo/socket -U psql
psql -p <port> -h <socket directory> -U <db user>
- Remove the temporary DRBD file system resources
lkcli resource delete /tmp/pgsql-demo
- Remove the datarep and temporary file system resources for DataKeeper for Linux.
lkcli resource delete –tag datarep-pgsql-demo
15. Verify switchovers and the connection
Why Migrate from SIOS DataKeeper for Linux to DRBD?
Migrating from SIOS DataKeeper for Linux to DRBD is a simple process for those who want to experiment with DRBD features within LifeKeeper as well as for those who were previously more acquainted with DRBD or want to take advantage of DRBD’s faster async replication speed and a broader array of kernel support.
Ready to get started with DRBD? Contact SIOS today to learn how LifeKeeper can help you migrate smoothly and leverage the full potential of DRBD for high availability and disaster recovery
Author: Cassius Rhue, VP of Customer Experience at SIOS Technology Corp.