0

I want to setup a DRBD active/active configuration with two nodes. My application will be doing I/Os directly on the DRBD device. I haven't seen any option to enable caching within DRBD.

Is there any linux module that would allow me to setup a cache in between DRBD and the disk module? Any caching above DRBD module can lead to stale data being read by the nodes.

mensi
  • 9,580
  • 2
  • 34
  • 43
Imran
  • 413
  • 5
  • 14
  • What are you trying to achieve? Do you just want to share data between applications that eventually gets written to disk at some point later on? What are your requirements? – mensi Jun 24 '12 at 14:44
  • This is going to be a high availability cluster. The application are going to use the disk as their custom block based storage for very high performance. Since DRBD was doing the replication, having a cache layer below DRBD would save me from notifying the other system of flushing the appropriate block from its higher level cache. – Imran Jun 24 '12 at 17:24
  • What do you mean by "higher level cache"? Can you extend your question to include specifics on what you want to build, since the answer depends on the type of application you have and how you access the shared block device? – mensi Jun 24 '12 at 17:37
  • Higher level would mean any module (file system, direct block access, etc.) accessing the drbd device as its storage. The application will access the shared block device by doing an open/mmap against the /dev/nnn device, and then do the I/O. Locking if necessary will be done using a distributed locking. The application can implement a userspace library that can use shared memory for caching etc., but it would need to be notified of blocks being modified on the other node. I would like to avoid that and use caching either at drbd or at a level below drbd. – Imran Jun 25 '12 at 03:20
  • I have found http://bcache.evilpiepirate.org/ which looks promising – Imran Aug 22 '12 at 05:30

1 Answers1

0

DRBD itself has 3 protocol types with varying guarantees. You could try using B or even A. However, all types block until the local write has been successful. As for caching writes to the disk explicitly, this SO question might provide further pointers on what is possible to do. Especially dannysauer's answer looks interesting.

Community
  • 1
  • 1
mensi
  • 9,580
  • 2
  • 34
  • 43