Ningappa
Ningappa

Reputation: 1329

Getting mongodb primary node from crashed replica set

Hi i have three mongo servers., 10.0.0.1, 10.0.0.2, 10.0.0.3,

I configured replica set between these three., All was working fine., because of server crash now all went wrong. 10.0.0.1 - this one showing "secondary", 10.0.0.2 - this one showing "unknown", 10.0.0.3 - this one showing "unknown",

how to reconfigure replication; I need either one should be a primary., means atleast i need one server as primary. how to get this.,

Upvotes: 1

Views: 849

Answers (1)

Ningappa
Ningappa

Reputation: 1329

I solved it myself. did some R&D. Basically i was not able get primary from either of these servers. But one server was secondary. so what i did was,

1.

Shutdown other servers by running db.shutdownServer() on "Unknown" servers.

2.

Deleted all data from dbpath folder (Inside Files not Folder) on these 2 servers.

3

Start mongo servers on both servers. This makes these mongo to be in STARTUP2 Status

This procedure gave me one Primary and recentlty restarted STARTUP2

I didn't touch Secondary server. that is 10.0.0.1 in my case.

Upvotes: 2

Related Questions