夏期劇場
夏期劇場

Reputation: 18327

MongoDB : Is it possible to store "Data Directory" on GlusterFS Volume (across Multiple VMs), so that standby Mongo Server can use it when required?

I'm a newbie in MongoDB. And I'm sorry if the Question is not clear enough. What i mean is:

Here the main question comes in (please refer to the picture below):

(1) Will everything be still working?
(2) Will there be 'lock' issues as in MySQL?
(3) If it works, does it mean, we can add any amount of MongoDB Servers (in stand-by mode), and whenever they swing, there's no problem?

enter image description here


Note:

Only 1 Server at a time will be running. Not like: the Data Store is being accessed by multiple Server.

Thanks for all opinions in advanced :)

Upvotes: 1

Views: 2225

Answers (2)

Sarath Nair
Sarath Nair

Reputation: 2868

Yes you can. There won't be any problem in moving the data files to a different server as long as you plan to use the same version of mongodb and the same operating system. When you move the files make sure to delete the mongodb.lock file if it exists in data directory.

Upvotes: 2

anand
anand

Reputation: 727

Glusterfs is good for file replication between various servers, but its not good idea to sync mongodb data using glusterfs.
Will everything be still working?
probabily no
Will there be 'lock' issues as in MySQL?
yes it will be. check this https://docs.mongodb.org/v3.0/faq/concurrency/ .glusterfs locks the file while it write on gluster-volumes and mongodb data may change frequently which could result problem.

you can consider mongodb replication (https://docs.mongodb.org/manual/core/replication-introduction/) for your purpose

Upvotes: 0

Related Questions