Mongodb – Can drbd be used for mongodb replication or active/passive setting

master-master-replicationmaster-slave-replicationmongodbreplication

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

https://www.howtoforge.com/how-to-set-up-an-active-passive-postgresql-cluster-with-pacemaker-corosync-and-drbd-centos-5.5-p4

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?

Best Answer

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.