Is it possible to view the synced data in the secondary replica set of mongodb ?
rs0:SECONDARY> use testdb
switched to db testdb
rs0:SECONDARY> db.auth("tester","123123")
1
rs0:SECONDARY> db.zips.find().pretty();
error: { "$err" : "not master and slaveOk=false", "code" : 13435 }
I'm getting this error when I tried to view the synced data or what is the command to view the synced data in the secondary mongodb? Did I miss any steps?
You have to run
rs.slaveOk()
http://docs.mongodb.org/manual/reference/method/rs.slaveOk/
To say to db that you know you are reading from secondary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With