How can I tell which secondary the MongoDB PHP driver is reading from? -


i using legacy mongodb driver (1.6.x) connect mongodb (2.4.x) replicaset. i've got "?readpreference=secondary" in connection string , 2 mongodb secondaries on replicaset. connection string includes servers:

mongodb://dev-mongo01:27017,dev-mongo02:27017,dev-mongo03:27017/?replicaset=dev-mongo-replica&readpreference=secondary 

i'd find out secondary read comes both verify readpreference working expected , calculate secondary's replication delay. i've tried looking @ mongoclient->getconnections(), mongoclient->gethosts(), "serversatus" , "replsetgetstatus" admin database can't find tells me secondary providing data.

if it's verify whether code reading right server, mongodb.log right place for. you'll see who's connecting node , ip address.

also, can turn on profiling set:

db.setprofilinglevel(2); 

to record operations clients. careful because way reduce performance lot. turn off by:

db.setprofilinglevel(0); 

if looking way control secondary should serve specific requests, replica set tag looking for.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -