{"id":20161678,"url":"https://github.com/jorgermduarte/mongo-replication","last_synced_at":"2025-03-03T02:43:29.863Z","repository":{"id":186843913,"uuid":"675760864","full_name":"jorgermduarte/mongo-replication","owner":"jorgermduarte","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-03T05:15:26.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T10:46:58.543Z","etag":null,"topics":["cluster","data","mongo","mongodb","mongoose","replica","replica-set","replication"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jorgermduarte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-07T16:53:34.000Z","updated_at":"2023-11-03T05:16:16.000Z","dependencies_parsed_at":"2024-11-14T00:20:09.068Z","dependency_job_id":"84cda78a-84c5-4a1b-9ed9-ecd34f54c00e","html_url":"https://github.com/jorgermduarte/mongo-replication","commit_stats":null,"previous_names":["jorgermduarte/mongo-cluster"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fmongo-replication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fmongo-replication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fmongo-replication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgermduarte%2Fmongo-replication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgermduarte","download_url":"https://codeload.github.com/jorgermduarte/mongo-replication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600483,"owners_count":19988713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","data","mongo","mongodb","mongoose","replica","replica-set","replication"],"created_at":"2024-11-14T00:20:06.344Z","updated_at":"2025-03-03T02:43:29.837Z","avatar_url":"https://github.com/jorgermduarte.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo-replication\n\nThis example creates a mongo replication with 3 nodes (1 primary and 2 secondary).\n\n![Replication Nodes](images/nodes.png)\n\n## Replication in mongodb\n\n-  A replica set is a group of mongod instances that maintain the same data set. A replica set contains several data bearing nodes and optionally one arbiter node. Of the data bearing nodes, one and only one member is deemed the primary node, while the other nodes are deemed secondary nodes.\n\n- The primary node receives all write operations. A replica set can have only one primary capable of confirming writes with { w: \"majority\" } write concern; although in some circumstances, another mongod instance may transiently believe itself to also be primary. [1] The primary records all changes to its data sets in its operation log, i.e. oplog. For more information on primary node operation, see Replica Set Primary.\n\n- The secondaries replicate the primary’s oplog and apply the operations to their data sets such that the secondaries’ data sets reflect the primary’s data set. If the primary is unavailable, the replica set will elect a secondary to be primary. For more information on secondary members, see Replica Set Secondary Members.\n\n\u003e for more information read : https://www.mongodb.com/docs/v3.0/core/replication-introduction/\n\n\n\n## Executing\n\n\u003e docker compose up mongo-setup --build -d\n\n## Testing the connection ( connecting thru an application on containers)\n\n\u003e docker compose up mongo-connection-test --build\n\nyou should notice in the output: **\"Connected to mongo1 successfully\"**\n\n![Connection Test](images/connection_test.png)\n\n## Running the backup service\n\n\u003e docker compose up backup-service --build -d\n\nA new backup with a random uuid will be created on the app/temp_backup directory\n\n![Backup example](images/backup_example.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgermduarte%2Fmongo-replication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgermduarte%2Fmongo-replication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgermduarte%2Fmongo-replication/lists"}