Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

MongoDB replSet takes forever to initiate

$
0
0

I'm setting up a replica set on my localhost just to get practice working with the necessary commands. I'm doing it both at home and at work. At home, the rs.initiate() command takes about three seconds to run, and it takes about another two or three minutes for rs.status() to give me all states that are either PRIMARY or SECONDARY. This is about what I expected.

But when I do it at work, rs.initiate() takes almost 7 minutes just to give me back my prompt in the mongo shell, then another 10 minutes before the states are all PRIMARY or SECONDARY. In the meantime, the one from which I initiated the connection is in SECONDARY or PRIMARY and the other two are RECOVERING. They just sit there, RECOVERING, for ten minutes.

While the rs.initiate() command is running, the mongod to which I've connected (port 10001) keeps spitting out stuff about "allocating datafile", then "done allocating datafile", then "allocating new datafile", and so on until it's got about a dozen of those files. The other two just sit there with "replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)" the whole time.

While I'm checking rs.status(), the two secondaries keep accepting and dropping connections, and allocating datafiles much like the primary does during the first step.

So is it supposed to take this long? And, if so, why does my machine at home do it in seconds? The only difference is that the one I'm running at home is 32-bit instead of 64-bit.


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>