MongoDB PHP driver didn't figure out the new primary

62 views
Skip to first unread message

DipakBiswal

unread,
Jan 24, 2012, 12:43:14 AM1/24/12
to mongodb-user
Hi,

We are using mongodb 2.0.2 in replica set mode and it has 3 nodes
(mongo1(P), mongo2(S) and mongo3(S)). We are connecting to these
replica set from Web servers (CentOS, PHP.5.3.8.2,CakePHP 2.0.4,
mongoDB PHP driver version 1.2.6) Yesterday Primary node got switched
from Mongo1 to Mongo2 automatically and mongo1 converted to
secondary , but MongoDB PHP driver didn't figure out the new primary ,
I have forcefully make the Mongo1 Primary again. What should be the
possible reason ?

These servers are EC2 instances. I am sharing the 10gen monitoring
screen shot of mongo1 , it shows a strip and I am unable to
understand the meaning of that,

http://www.4shared.com/photo/ocDPWn1l/MMS__mongo1applectcom_27017.html


Thanks,
Dipak

Dipak Biswal

unread,
Jan 24, 2012, 11:23:12 AM1/24/12
to mongodb-user
Again we have faced the same problem today. While connecting to
mongo1 from shel I got following error message:
connecting to: localhost:27017/admin
Tue Jan 24 20:56:02 DBClientCursor::init call() failed
Tue Jan 24 20:56:02 Error: Error during mongo startup. :: caused by ::
DBClientBase::findN: transport error: localhost:27017 query: {
whatsmyuri: 1 } shell/mongo.js:86
exception: connect failed

--
Regards,
Dipak

Adam C

unread,
Jan 24, 2012, 12:35:43 PM1/24/12
to mongodb-user
Hi Dipak,

When the failover happened, do you have a good handle on why the
primary is stepping down?

If I read this right, the step down and the election of the new
primary is happening as you expect, but whenever the primary is not
mongo1, the PHP driver is not picking up the change - correct?

Can you connect from the PHP host to each of the replica set members
directly? (mongo <hostname> if you have mongo installed, or even a
telnet to the port if not).

Adam

prashant gupta

unread,
Sep 11, 2012, 8:58:25 AM9/11/12
to mongod...@googlegroups.com, dipak....@gmail.com
I am also getting the same error message while connecting to mongo server from shell.
But I do get this message after 8-9 minutes , I attempt to connect to server.
 For 8-9 mintues, it hangs out. Can i do set some connection time out so that I can receive this error message soon ?

Thanks,
Prashant Gupta
Reply all
Reply to author
Forward
0 new messages