Failure of all but 1 member of a replica set makes set unavailable

126 views
Skip to first unread message

David M

unread,
Aug 2, 2010, 10:04:15 PM8/2/10
to mongodb-user
In a 3 member replica set, if 2 of the members are down then the set
becomes unavailable. What's the reason for this?

In the documentation at http://www.mongodb.org/display/DOCS/Sharding+and+Failover
it says

"If the shard is configured as a replica set, with at least one member
of the set in another data center, then an outage of an ensure shard
is extremely unlikely."

but this is not the case because if there is only 1 member in another
DC and the other members go down, the shard will become unavailable
unless it includes members from another replica set. Is this the
assumption - that a shard will be distributed across multiple replica
sets?

Dwight Merriman

unread,
Aug 2, 2010, 10:58:38 PM8/2/10
to mongod...@googlegroups.com
the sharding documentation is confusing.

a majority must be up for a replica set to be online.

however, you can add an arbiter to assure this.



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Kristina Chodorow

unread,
Aug 2, 2010, 10:57:24 PM8/2/10
to mongod...@googlegroups.com
If two members are down, the set becomes read-only (so, not exactly
unavailable). This is to avoid multi-master conflicts in the case of
network partitions.

We assume each shard will be one replica set, that may be read-only in
case of disaster. It's one of the tradeoffs of a stronger consistency
model.


On Mon, Aug 2, 2010 at 10:04 PM, David M <da...@boxedice.com> wrote:

Tat Sean

unread,
Aug 4, 2010, 11:45:05 PM8/4/10
to mongodb-user
Hi Kristina Chodorow, it seems that the "READ" does not work as well
if 2 nodes of 3 nodes in a replica set are brought down. i got

"uncaught exception: count failed : {"errmsg" : "not master", "ok" :
0}

Any advice?

On Aug 3, 10:57 am, Kristina Chodorow <krist...@10gen.com> wrote:
> If two members are down, the set becomes read-only (so, not exactly
> unavailable).  This is to avoid multi-master conflicts in the case of
> network partitions.
>
> We assume each shard will be one replica set, that may be read-only in
> case of disaster.  It's one of the tradeoffs of a stronger consistency
> model.
>
> On Mon, Aug 2, 2010 at 10:04 PM, David M <da...@boxedice.com> wrote:
> > In a 3memberreplica set, if 2 of the members are down then the set
> > becomes unavailable. What's the reason for this?
>
> > In the documentation athttp://www.mongodb.org/display/DOCS/Sharding+and+Failover
> > it says
>
> > "If the shard is configured as a replica set, with at least onemember
> > of the set in another data center, then an outage of an ensure shard
> > is extremely unlikely."
>
> >butthis is not the case because if there is only1memberin another

Oli

unread,
Aug 5, 2010, 8:59:30 AM8/5/10
to mongodb-user
I discovered the same problem.
In a shard replSet of two nodes, if one node becomes unavailable, the
whole set
is neither readable nor accessable at all.

mongodb 1.5.8

Kristina Chodorow

unread,
Aug 5, 2010, 9:09:27 AM8/5/10
to mongod...@googlegroups.com
You have to set slaveOk to do reads.   In the shell:

> slave.getMongo().setSlaveOk()
> slave.foo.find()

Each driver has some sort of syntax for this.

Slaves are, by default, for backup only, so you don't accidentally read stale data.
Reply all
Reply to author
Forward
0 new messages