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. – cloud_cloud Jul 21 '17 at 5:53
  • 1
    Why would you want to use drbd when you can use a replica set? – Markus W Mahlberg Jul 21 '17 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. – cloud_cloud Jul 21 '17 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). – Markus W Mahlberg Jul 22 '17 at 11:16
  • Oh, and just for completeness: replica sets offer automatic failover. – Markus W Mahlberg Jul 22 '17 at 11:18

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.

| improve this answer | |
  • Okay, this is what I want. A clear answer. Thank you! – cloud_cloud Jul 21 '17 at 7:47
  • However this is only partially true. You could have an active / passive cluster run on it – Markus W Mahlberg Jul 22 '17 at 11:05
  • @MarkusWMahlberg Could you tell me what's meaning of it? And how to do? – cloud_cloud Jul 24 '17 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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