0

I got the following errors when the master replica is down

ConnectionPool::PoolShuttingDownError (ConnectionPool::PoolShuttingDownError):
Moped::Errors::ConnectionFailure (Could not connect to a primary node for replica set #<Moped::Cluster:70117691586500 @seeds=[<Moped::Node resolved_address="0.0.0.0:27017">]>

I have 3 mongoDB replica.

It seems the primary replica is 172.19.16.109:27017

I don't understand why I shutdown the machine 172.19.16.109,

And remaining 2 replicas are unavailable to load data from its database.

Is it not making sense for the replicas ? Once if the master is shutdown, the others are also unavailable, too.

I expect that even if any replica is down, the others should work correctly.

My configurations are as below.

vvtk_dqa:PRIMARY> rs.conf()
{
    "_id" : "vvtk_dqa",
    "version" : 4,
    "members" : [
        {
            "_id" : 1,
            "host" : "172.19.16.109:27017"
        },
        {
            "_id" : 2,
            "host" : "172.19.16.104:27017"
        },
        {
            "_id" : 3,
            "host" : "192.168.14.7:27017"
        }
    ]
}

mongodb.conf

# Where to store the data.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 0.0.0.0
#port = 27017

# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true

replSet=vvtk_dqa

isMaster

vvtk_dqa:PRIMARY> rs.isMaster()
{
    "setName" : "vvtk_dqa",
    "setVersion" : 4,
    "ismaster" : true,
    "secondary" : false,
    "hosts" : [
        "172.19.16.109:27017",
        "192.168.14.7:27017",
        "172.19.16.104:27017"
    ],
    "primary" : "172.19.16.109:27017",
    "me" : "172.19.16.109:27017",
    "maxBsonObjectSize" : 16777216,
    "maxMessageSizeBytes" : 48000000,
    "maxWriteBatchSize" : 1000,
    "localTime" : ISODate("2015-02-11T02:05:12.021Z"),
    "maxWireVersion" : 2,
    "minWireVersion" : 0,
    "ok" : 1
}
  • 1
    After you take 172.19.16.109 down, can you log in to either of the other two MongoDB servers with the mongo shell? If not, what are the error? If so, what does rs,status() say? – Wesley Feb 11 '15 at 6:28
  • And by rs,status() I mean rs.status() (was typing late at night) – Wesley Feb 11 '15 at 16:23
0

adding

gem 'moped', '2.0.4', github: 'wandenberg/moped', branch: 'operation_timeout'

to Gemfile helped me. more info: https://github.com/mongoid/moped/issues/348

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.