0

When I have a running MongoDB instance with some data and requests against it, can I start a second instance on another machine, register it as another node in the first instance and all the data is copied to the second node while changes on the first node in the meantime are also mirrored to the second instance? Is that possible?

The context is: I have a single machine deployment with an application and mongodb running on the same instance (Amazon EC2). Its a low budget deployment but I try to have as few downtime as possible. I'd like to change the ec2 instance every week and for that I'd need some sort of mirroring. Is that possible?

asked Apr 13, 2016 at 7:17

1 Answer 1

1

You can replicate data from one server to others using Replication feature in MongoDB.

The replica set ensures high availability and redundancy of you mongodb data in case if node failure. In your case, you can create a replica set of 3 nodes (PRIMARY, SECONDARY, ARBITER). When one of the server goes down, Secondary would be promoted as PRIMARY which ensures high availability of MongoDB data.

It is always recommended to have at least 3 members in replica set.

You can find detailed document here

answered Apr 13, 2016 at 12:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.