3

I have a 3 member replica set running. It's geo-located on 3 separate VPSs. On primary I can do rs.status() and see it's working. I can't execute any mongo shell commands on the secondaries. How do I verify data replication on other servers? I see nothing indicating data being copied in the logs.

Thanks a lot for any help :-)

Edit 1:

Tried db.printSlaveReplicationInfo(). Logged in as user with full admin role...

Admin user not authorized

Edit 2:

enter image description here

1 Answer 1

5

For querying secondary run the following command first. After running this, you can do all regular stuff on secondary.

rs.slaveOk()

To see the replication status, run the following command on primary. This will show you if the secondaries are up to date or lagging.

db.printSlaveReplicationInfo()

Hope this helps.

4
  • Hey Abhay, thanks for the idea! I tried it and posted my screen above. What do you think? Oops... switched to admin db and logged in again and it worked. I'll post the screen in sec...
    – Locohost
    May 4, 2015 at 12:10
  • After logging in admin db, looks like the replication info shows it's sync'd. Is that what that reads?
    – Locohost
    May 4, 2015 at 12:16
  • Looks like it's synced. BTW, rs.slaveOk() is needed if you want to query secondary.
    – Abhay PS
    May 4, 2015 at 12:26
  • Thank you Abhay! I've learned a lot about MongoDb the last couple months. Still figuring it all out ;-)
    – Locohost
    May 4, 2015 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.