README
Setup
Initialize the replica set
docker compose up -d
docker compose exec mongo1 mongosh --eval "rs.initiate({
_id: \"myReplicaSet\",
members: [
{_id: 0, host: \"mongo1\"},
{_id: 1, host: \"mongo2\"},
{_id: 2, host: \"mongo3\"}
]
})"
Details about the replica set with Docker can be found here.
Makes sure the replica set is working
docker compose exec mongo1 mongosh --eval "rs.status()"