add rs.slaveOk to run before the getDBs call#446
Conversation
079c929 to
08b9b53
Compare
|
Is it possible to add a test for the behavior you're seeing with the 2nd and 3rd replicas? Otherwise, the code itself looks ok, but I don't have experience with mongoDB to know if it's an appropriate solution. |
|
A quick google shows that replica sets replace master-slave, and the latter is deprecated starting in MongoDB 3.6. Again, I don't have experience with MongoDB, but it seems like maybe there are other solutions here, perhaps dependent on the version in use. |
|
Hoi @TomRitserveldt, thanks for the PR! Can you take a look at the comments from @rnelson0 ? |
|
Yes, I'm currently looking into some alternative ways to get around or fix this issue. |
|
@TomRitserveldt : Have you setup the replication with Auth Enabled or Disabled ? I am trying to setup with Auth enabled but getting following error :
|
|
@Dharmender-Singh Sorry no I am setting it up without auth enabled. |
5bc5a34 to
b87a926
Compare
…the slaves in a multi node replica mongo setup.
|
Any chance this could still get merged? |
otherwise puppet runs fail on the slaves in a multi node replica mongo setup.
how this occurs from what I've been able to see:
provision 3 vm's:
to fix this we must pass the rs.slaveOk() command before the printjson(db.getMongo().getDBs()), in order to allow the current connection to allow read operations to run on secondary members.
which I hope to solve with this pull request, if there are cleaner/better ways to fix this issue, I'm open to suggestions.