From this guide we know DRBD can used for PostgreSQL Active/Passive setting:


It use /dev/drbd0 to mount PostgreSQL data path /var/lib/psql:

mount -t ext3 /dev/drbd0 /var/lib/pgsql

So is it possible to use this way to mount a MongoDB data path and where is that path?(Maybe this on CentOS 7.3: /var/lib/mongo

If use this way, the multiple nodes will use the synced same file data but not master-slave replication. Maybe this is called master-master replication. Is it good?

  • @a_horse_with_no_name About MongoDB. PostgreSQL works well. I want to confirm whether it is possible for MongoDB by this way. Jul 21, 2017 at 5:53
  • 1
    Why would you want to use drbd when you can use a replica set? Jul 21, 2017 at 7:14
  • @MarkusWMahlberg Because now we want not only do the replication for MongoDB, but also want to do for PostgreSQL on the same database cluster. So if use drbd to control multiple resources maybe a good way. Off course use official PostrgreSQL/MongoDB replication method can go well. Now just want to confirm whether this is a common or right way in the world. Jul 21, 2017 at 7:19
  • 1
    A) Do not share machines for DBMS. B) much less share disks between DBMS, much less partitions C) Do not use drbd for disks or partitions used by an RDBMS. Split brain situations, locking problems, added latency for writes and whatnot might occur. Depending on mode and distance, as well as your connection type, things like line jitter and loss rate might cause additional headaches. This applies to both MongoDB and Postgres. I love drbd and use it quite often, but what you are trying to do is a Very Bad Idea (tm). Jul 22, 2017 at 11:16
  • Oh, and just for completeness: replica sets offer automatic failover. Jul 22, 2017 at 11:18

1 Answer 1


Answer is NO, you cannot use it with MongoDB. Result would be corrupted data, sooner or later. MongoDB keeps active data in memory and don't know how to react if data is changed "on-the-fly" at disk.

  • Okay, this is what I want. A clear answer. Thank you! Jul 21, 2017 at 7:47
  • 1
    However this is only partially true. You could have an active / passive cluster run on it Jul 22, 2017 at 11:05
  • @MarkusWMahlberg Could you tell me what's meaning of it? And how to do? Jul 24, 2017 at 1:27
  • I know this is an old post, but I just came across it. What @MarkusWMahlberg said is on point. With active / passive clustering, as the OP was asking about, there's no difference in using MongoDB on top of DRBD than there would be on any other block device. Jun 2, 2021 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.