Running a small mongo replica set with a primary, a secondary and an arbiter. Below is an output of the rs.status() describing the set:
rs0:PRIMARY> rs.status()
{
"set" : "rs0",
"date" : ISODate("2014-09-22T11:01:11Z"),
"myState" : 1,
"members" : [
{
"_id" : 2,
"name" : "mongo2:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 66657,
"optime" : Timestamp(1411383252, 1),
"optimeDate" : ISODate("2014-09-22T10:54:12Z"),
"electionTime" : Timestamp(1411383118, 1),
"electionDate" : ISODate("2014-09-22T10:51:58Z"),
"self" : true
},
{
"_id" : 3,
"name" : "warehouse:27017",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 433,
"lastHeartbeat" : ISODate("2014-09-22T11:01:10Z"),
"lastHeartbeatRecv" : ISODate("2014-09-22T11:01:10Z"),
"pingMs" : 0
},
{
"_id" : 4,
"name" : "mongo1:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 419,
"optime" : Timestamp(1411383252, 1),
"optimeDate" : ISODate("2014-09-22T10:54:12Z"),
"lastHeartbeat" : ISODate("2014-09-22T11:01:10Z"),
"lastHeartbeatRecv" : ISODate("2014-09-22T11:01:09Z"),
"pingMs" : 0,
"syncingTo" : "mongo2:27017"
}
],
"ok" : 1
}
All servers are running mongo 2.6.4, the php MongoClient has been updated to the latest version. My computer is running osx 10.9. Running aggregation jobs in the mongo cli seems to be just fine, but as soon as I try to start an aggregation job, I get the following error:
CON FINE: Using 30000 from default with
I'm catching the exception and its code is 0. I can't really make sense of this exception, nor can I find any references to it online. The mongo logs seem to indicate that the connection is being opened and then closed, without any errors. Communication between the servers is also just fine, the keys are copied over and the hosts files are up to date.
I can't seem to be able to run even simple queries like
$m = new MongoClient('mongodb://mongo2/?replicaSet=rs0');
$m->admin->command(array("ismaster" => 1))
Any ideas are appreciated.