Dat Nguyen
Dat Nguyen

Reputation: 1891

MongoDb replication set become Secondary when restart server

I am using virtualbox to create Mongodb replication set. I have initiated the primary on first server. However, when I restart virtualbox the primary become the secondary. Please help me reset replication Set and how to return to the primary

Upvotes: 0

Views: 552

Answers (1)

Lalit Agarwal
Lalit Agarwal

Reputation: 2354

When you restart your virtual box then there is an election which takes place and mongo selects one of your servers to become primary. If at all you want your selected mongod to be made primary all the time then there are various things you could do.

For more replica set configuring options look here

http://docs.mongodb.org/manual/reference/replica-configuration/

You could even use the votes parameter to suffice your need.

Upvotes: 2

Related Questions