Hi,
I currently have MongoDB as a replica on 3 Docker containers on Machine_1. All is running great.
But, I wish to create a Production environment running on Machine_2. It will be the same architecture, so using a replica of MongoDB and running in 3 containers. It will be my master DB.
So Machine_1 with its replica will remain a copy to Machine_2 (Production).
I would love to have both replicas to be synchronised (Machine_1 replica and Machine_2 replica).
My Machine_1 is my laptop where I develop an App, so it updates the MongoDB replica on that machine (1) as a local DB.
On Machine_2, there is a production App running, which will also update the local MongoDB replica on that machine (2)
I wish them to sync if connected in the same network or if seeing each other.
What would you suggest doing?
Run Kubernetes Cluster with two nodes (Machine_1, Machine_2), and in each node runs MongoDB replicas.
But then, how do they sync?
The IP of the machines can change; there is no DNS as of now.
Thanks, Jakub