PHP MongoDB errors when using automatic failover -
i'm having hardest time trying figure 1 out. have 2 server replica set 1 arbiter running alongside current primary.
when connect or issue queries, intermittent errors range 1 of following:
- could not determine master.
- could not connect [put host here].
- broken pipe exceptions.
- mongocursorexceptions.
it seems happen more longer servers up. after awhile, no connections can made , following error when try , login mongo shell:
mongodb shell version: 1.8.1 connecting to: test wed may 11 16:36:50 messagingport recv() errno:104 connection reset peer 127.0.0.1:27017 wed may 11 16:36:50 socketexception: remote: error: 9001 socket exception [1] wed may 11 16:36:50 dbclientcursor::init call() failed exception: dbclientbase::findone: transport error: 127.0.0.1 query: { whatsmyuri: 1 }
(btw, verbose (-vvvv) logging, 9001 socket exception seems come every query run.)
when restart mongo servers, things come , start working, not long.
no matter combination of connection options used, nothing worked. when changed both webservers connect primary replica started working. no errors. no automatic failover :(. weird thing was, replicaset option still set means php driver still needs determine whether or not 1 connected master , if not connect it, if so, nothing.
this tells me issue resides in php driver tries connect master after attempting determine if connected master or not. try , theory, told 1 of servers connect secondary server. immediately, started getting errors server. not other server still connected primary. switch back, no errors.
can shed light on this?
my setup: - 2 webservers - apache/php on both - mongodb replica-set span across both - secondary on 1 - primary , arbiter on other - mongodb 1.8.1 - php driver 1.1.4 - php 5.3.3 - apache 2.2.17 - redhat 5.5 (tikanga)
this repost of active thread on mongodb user mailing list.
may best close , let discussion finish out there.
Comments
Post a Comment