Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <blockquote> <p>Taking a simple example of 2 mongoDB instances A (primary) and B (secondary).</p> </blockquote> </blockquote> <p>You should not use two instance as part of your replica set. You should either have an <a href="http://docs.mongodb.org/manual/administration/replica-sets/#replica-set-arbiters" rel="nofollow">arbiter</a> or another secondary so that elections can take place.</p> <p>Please see <a href="http://www.mongodb.org/display/DOCS/Gotchas" rel="nofollow">here</a> for gotchas, <a href="http://docs.mongodb.org/manual/core/replication/" rel="nofollow">here</a> for replication fundamentals and <a href="http://docs.mongodb.org/manual/core/replication/#replica-set-elections" rel="nofollow">here</a> for information on elections.</p> <blockquote> <blockquote> <p>If my client is happily querying A I understand that writes get replicated to B but what happens if server A becomes inaccessible?</p> </blockquote> </blockquote> <p>The service should <a href="http://docs.mongodb.org/manual/faq/replica-sets/#how-long-does-replica-set-failover-take" rel="nofollow">failover</a> with server B becoming primary. However, with two instances, server B will not be able to elect itself as primary because there is no majority.</p> <blockquote> <blockquote> <p>Whilst in terms of mongo replication I can see that B gets elected as the new primary, how does the client know to now channel its queries to B and not A? Is this all done internally to mongo?</p> </blockquote> </blockquote> <p>This is typically performed through the driver as the driver is aware of the replica set configuration. Please see <a href="http://www.mongodb.org/display/DOCS/Drivers" rel="nofollow">here</a> for the relevant driver documentation (depending on what driver you are using).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload