{"id":13566646,"url":"https://github.com/singram/mongo-docker-compose","last_synced_at":"2025-04-04T00:31:39.925Z","repository":{"id":146611741,"uuid":"42813882","full_name":"singram/mongo-docker-compose","owner":"singram","description":"Fully sharded mongo environment using docker-compose","archived":false,"fork":false,"pushed_at":"2019-02-20T12:12:07.000Z","size":14,"stargazers_count":110,"open_issues_count":3,"forks_count":55,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-01T13:36:44.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/singram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-09-20T13:26:51.000Z","updated_at":"2024-07-28T14:34:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"22741c41-2c7c-4fe7-9f85-bb20e7bc4142","html_url":"https://github.com/singram/mongo-docker-compose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singram%2Fmongo-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singram%2Fmongo-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singram%2Fmongo-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singram%2Fmongo-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/singram","download_url":"https://codeload.github.com/singram/mongo-docker-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223075297,"owners_count":17083497,"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":[],"created_at":"2024-08-01T13:02:13.869Z","updated_at":"2024-11-04T21:30:36.954Z","avatar_url":"https://github.com/singram.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# mongo-docker-compose\nThis repository provides a fully sharded mongo environment using docker-compose and local storage.\n\nThe MongoDB environment consists of the following docker containers\n\n - **mongosrs(1-3)n(1-3)**: Mongod data server with three replica sets containing 3 nodes each (9 containers)\n - **mongocfg(1-3)**: Stores metadata for sharded data distribution (3 containers)\n - **mongos(1-2)**: Mongo routing service to connect to the cluster through (1 container)\n\n## Caveats\n\n - This is designed to have a minimal disk footprint at the cost of durability.\n - This is designed in no way for production but as a cheap learning and exploration vehicle.\n\n## Installation (Debian base):\n\n### Install Docker\n\n    sudo apt-get install -y apparmor lxc cgroup-lite curl\n    wget -qO- https://get.docker.com/ | sh\n    sudo usermod -aG docker YourUserNameHere\n    sudo service docker restart\n\n### Install Docker-compose (1.4.2+)\n\n    sudo su\n    curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` \u003e /usr/local/bin/docker-compose\n    chmod +x /usr/local/bin/docker-compose\n    exit\n\n### Check out the repository\n\n    git clone git@github.com:singram/mongo-docker-compose.git\n    cd mongo-docker-compose\n\n\n### Setup Cluster\nThis will pull all the images from [Docker index](https://index.docker.io/u/jacksoncage/mongo/) and run all the containers.\n\n    docker-compose up\n\nPlease note that you will need docker-compose 1.4.2 or better for this to work due to circular references between cluster members.\nYou will need to run the following *once* only to initialize all replica sets and shard data across them\n\n    ./initiate\n\nYou should now be able connect to mongos1 and the new sharded cluster from the mongos container itself using the mongo shell to connect to the running mongos process\n\n    docker exec -it mongos1 mongo --port 21017\n\n## Persistent storage\nData is stored at `./data/` and is excluded from version control. Data will be persistent between container runs. To remove all data `./reset`\n\n## TODO\n\n - Add local Ops Mananger\n - Implement authentication across cluster.  http://docs.mongodb.org/manual/tutorial/deploy-replica-set-with-auth/\n\n## Built upon\n - [Docker-compose wait to start](http://brunorocha.org/python/dealing-with-linked-containers-dependency-in-docker-compose.html)\n - [Bi directional docker commuication](http://abdelrahmanhosny.com/2015/07/01/3-solutions-to-bi-directional-linking-problem-in-docker-compose/)\n - [MongoDB Sharded Cluster by Sebastian Voss](https://github.com/sebastianvoss/docker)\n - [MongoDB](http://www.mongodb.org/)\n - [Mongo Docker ](https://github.com/jacksoncage/mongo-docker)\n - [DnsDock](https://github.com/tonistiigi/dnsdock)\n - [Docker](https://github.com/dotcloud/docker/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingram%2Fmongo-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsingram%2Fmongo-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingram%2Fmongo-docker-compose/lists"}