TETRA2000 / rails_with_mongodb_cluster

Example code for Rails with MongoDB cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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()"

About

Example code for Rails with MongoDB cluster


Languages

Language:Ruby 73.9%Language:HTML 20.0%Language:JavaScript 3.5%Language:CSS 2.0%Language:Dockerfile 0.6%