top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Switching between replication and standalone modes in MongoDB?

0 votes
157 views

In my project we need the system to work sometimes as standalone DB without communication to else computers and sometimes in replication mode to reflect all the DB data to else computers. when we switch between options we restart all the system ans its considered as new activity with new tables. the decision if to use more computers (and than we need replication) is of the customer.

Im using ubuntu OS (linux) and I have a services to apply mongodb in every situation (replication / standalone).
my question is if in such case, can I use the same port/ DB folder/ logger of the mongodb for replication and standalone, and apply the services according to the customer decision or I must apply the mongodb in else port/ DB folder/ logger for replication and standalone modes to prevent problems?

posted Feb 27, 2018 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I have a biggest database in production server, I need to configure replication set for this, But I dont want to start it from initial sync. I need to configure it like Mysql replication.

The flow is,
Take dump from prod.
Restore it in Secondary.
Enable replication in config file.
Restart mongod services.rs.Initiate () from primaryrs.add("xxxxx")

But when I execute the rs.add command till start sync the database from the scratch. Is there any other possibilities to achieve this?

...