Some applications require direct access to a block device, without an intermediate file system. Some Oracle and MySQL configurations are an example, as are some Xen setups, or IET. Can you do this with DRBD? Sure you can.
However, you need to fulfill two prerequisites:
- Your application can’t access DRBD while it’s in the
Secondary
role. So, you must make sure DRBD isPrimary
before your application attempts using that device. - The user in whose context your application runs needs read/write access to that device.
Your cluster manager, when configured properly, normally takes
care of item #1 for you. #2 is a little trickier:
Normally, DRBD’s device nodes are owned by
root:disk
, with permission bits set to
0660
(rw-rw----
). So in order to allow
your application to use the device, you have two options:
- Add …