Reputation: 18327
I'm a newbie in MongoDB. And I'm sorry if the Question is not clear enough. What i mean is:
CentOS-1
and CentOS-2
mongod
on both CentOS boxes. But start (run) only one. (The other one on CentOS-2
might be purposely stopped)CentOS-1
.Here the main question comes in (please refer to the picture below):
CentOS-1
Server goes down, and i manually start the another MongoDB Server (mongod
on the another box CentOS-2
), and let all the Applications to connect to CentOS-2
:(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?
Note:
Thanks for all opinions in advanced :)
Upvotes: 1
Views: 2225
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
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