This section describes how to create a DRBD resource. DRBD resources provide the ability to build highly available clusters without the use of shared storage.
System Configuration
The environment created in this guide has the following two-node configuration. Create a mirror on your new file system and protect it with LifeKeeper.
Make sure that your configuration satisfies the following DRBD requirements.
Hardware and Software Requirements
Perform the following steps on “target1” and “target2”
- Checking the device
# parted /dev/sdb print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
- Creating a partition
Create a partition in /dev/sdb of the device.
# parted -s /dev/sdb mklabel gpt
# parted /dev/sdb mkpart primary 0% 100%
# parted /dev/sdb print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 1073MB 1072MB ext4 primary
Perform the following steps on the “target1”
- Creating a resource
Execute the following command:
[target1]# lkcli resource create drbd --tag drbd-tag --device /dev/sdb1 --fstype xfs --mount_point /mnt/fs --fstag fs-tag
Resource Settings
Item | Input Value |
---|---|
--tag | DRBD resource tag name |
--device | Source disk or partition |
--fstype | File system type |
--mount_point | Mount point |
--fstag | File system resource tag name |
- Extending a DRBD resource
Execute the following command:
[target1]# lkcli resource extend drbd --tag drbd-tag --dest target2 --mode synchronous --laddr 10.1.6.88 --raddr 10.1.6.89
Resource Settings
Item | Input Value |
---|---|
--tag | Tag name of the created DRBD resource |
--dest | The hostname of the target server where the resource hierarchy is extended |
--mode | Replication type |
--laddr | IP address on the local machine to be set for the communication path |
--raddr | IP address on the remote machine to be set for the communication path |
- Extending a file system resource
Execute the following command:
[target1]# lkcli resource extend fs --tag fs-tag --dest target2
Resource Settings
Item | Input Value |
---|---|
--tag | Tag name of the created file system resource |
--dest | The hostname of the target server where the resource hierarchy is extended |
- Checking the resource
After creating and expanding the resource, run the following command.
The resource information is returned.
[target1]# lkcli status -q
LOCAL TAG ID STATE PRIO PRIMARY
target1 fs-tag /mnt/fs ISP 1 target1
target1 drbd-tag B5A710C8DC21DB4A ISP 1 target1
A DRBD resource is automatically created with the file system resource dependent on the upper level as shown above.
- Check the mirroring
Once the DRBD resource has been extended, a partial resync will be performed.
When the resync is completed the status is Fully Operational.
[target1]# lkcli drbd status --tag drbd-tag
DRBD Resource Configuration:
[ ] target1 -> target2
Status: Fully Operational
[===============>] 100%
Out-of-Sync 0 KB, Pending: 0
Type: Synchronous
Post your comment on this topic.