How to setup a MongoDB replica set in EC2 US-WEST with only two availability zones

493 views Asked by At

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

There are 1 answers

0
SCB On

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