1

We are setting up a MongoDB replica set on Amazon EC2 in the us-west-1 region.

This region only has two availability zones though. My understanding is that MongoDB must have a majority to work correctly. If we create 2 servers in zone us-west-1b and one server in us-west-1c this will not provide high availability if the entire us-west-1b goes down right? How is this possible? What is the recommended configuration?

1
  • A majority needs to be present for a primary to be successfully elected and become writable. A stranded node would remain read-only if it already was, and would make itself read-only if it wasn't already, when the split occurred. Perhaps adding 2 arbiters in us-west-2? Jun 16, 2015 at 23:53

1 Answer 1

0

Having faced a similar challenge we looked at a number of possible solutions:

Put an Arbiter in another region:

Secure the connection either by using a point to point VPN between the regions a routing the traffic across this connection.

or

Give each server an E-IP and DNS name and use some combination of AWS security groups, IPTables and SSL to ensure connections are secure.

AWS actually have a whitepaper on this not sure how old it is though http://media.amazonwebservices.com/AWS_NoSQL_MongoDB.pdf

Alternatively you could allow the application to fall back to a read-only state until your servers come back on-line (not the nicest of options though)

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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