Pavel Tsukanov Posted April 1, 2021 Share Posted April 1, 2021 Hi I would like to have 2 MongoDB instances with Replica Set enabled https://docs.mongodb.com/manual/replication/ I.e. I would like to have cluster live when one of instances is offline Is it possible? We had a case when our Amazon MongoDb instance stopped to work due to a hardware issue and we want to avoid it. Thank you Pavel Link to comment Share on other sites More sharing options...
0 Connessione Posted April 1, 2021 Share Posted April 1, 2021 You can do this easily by setting up two separate working clusters and using AWS route 53 for dns routing. It already has health checks and everything you need. If the healthcheck detects a failed cluster it will route traffic to other cluster using same dns. You have to plan how to implement failure indication on your cluster so that route 53 can detect it. Link to comment Share on other sites More sharing options...
0 Pavel Tsukanov Posted April 2, 2021 Author Share Posted April 2, 2021 2 clusters are too expensive (we must have at least 2 always on antmedia servers in clusters + turn servers). Also it's additional business logic for us. It's not good solution for Us and I believe for all I have a big experience with mongo and I believe that adding Replica Set support is not a big task.. Compare the next connection strings mongodb://MongoDb1, MongoDB2/DbName?replicaSet=rs0;readPreference=primary;safe=true for ReplicaSet. Clients will query primary server only. and mongodb://MongoDb1/DbName for a single server If Antmedia server uses the standard MongoDB driver it will work automatically without changing business logic It needs just add a way to configure the connection string. Link to comment Share on other sites More sharing options...
0 Tahir Posted April 2, 2021 Share Posted April 2, 2021 Hi Pavel, Ant Media mongodb implemantation is open in the public. Here is the implementation class: https://github.com/ant-media/Ant-Media-Server/blob/master/src/main/java/io/antmedia/datastore/db/MongoStore.java . We are using morphia library to access mongodb through Java. I am not certain how the replica is being done at the moment, I can carry the replica configuration to the team if it is needed to add an external configuration. Meanwhile if you have experience working with mongodb, any commits are welcomed to make the replica work if you can make it work. Cheers Link to comment Share on other sites More sharing options...
Question
Pavel Tsukanov
Hi
Link to comment
Share on other sites
Top Posters For This Question
2
1
1
Popular Days
Apr 1
2
Apr 2
2
Top Posters For This Question
Pavel Tsukanov 2 posts
Tahir 1 post
Connessione 1 post
Popular Days
Apr 1 2021
2 posts
Apr 2 2021
2 posts
3 answers to this question
Recommended Posts