Thursday, December 4, 2014

pymongo.errors.AutoReconnect: not master

Cause:

Our mongo DB hasn't replica set config.

Verify replica set:

Log into mongo shell and do "rs.conf()", if it comes with "null" then do the following:

cfg = {"_id" : "rpls","version" : 1,"members" : [{"_id" : 0,"host" : "127.0.0.1:27017"}]}
This will set your instance as master, as described here:

http://stackoverflow.com/questions/13603096/starting-over-with-replica-configuration-in-mongodb


No comments:

Post a Comment