A Docker Compose setup for automatically initializing a MongoDB sharded cluster with replica sets for development and testing.
MongoDB Cluster Docker Compose is a pre-configured Docker Compose setup that automatically deploys a MongoDB sharded cluster with replica sets. It solves the problem of manually configuring the complex components required for MongoDB sharding and replication, providing a ready-to-use distributed database environment for development and testing purposes.
Developers, DevOps engineers, and database administrators who need a local or test environment that mimics a production MongoDB sharded cluster architecture without the manual setup overhead.
Developers choose this project because it dramatically reduces the time and expertise required to set up a MongoDB sharded cluster. It offers a production-like architecture out of the box with automated initialization, making it ideal for development, testing, and learning about MongoDB's scaling features.
docker-compose for mongodb cluster sharded with replication
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses entrypoint scripts to automatically set up sharding and replica sets on first run, eliminating manual configuration steps as shown in the installation commands.
Deploys a complete sharded cluster with config servers, three shards (each a 3-member PSS replica set), and two mongos routers, mirroring real-world setups for realistic testing.
Includes ready-to-use Docker commands for checking cluster status, enabling sharding, and cleaning up, reducing operational overhead during development.
Provides direct connection strings (e.g., for MongoDB Compass) and .NET client examples, making it easy to integrate with applications from the host machine.
Spins up over 14 Docker containers concurrently, consuming significant memory and CPU, which can strain local development machines and slow down performance.
The README warns of VirtualBox issues on Windows and macOS, requiring workarounds like WSL2 or file format adjustments, adding friction for cross-platform use.
Authentication is not enabled by default; users must switch to a separate branch for keyfile authentication, complicating secure setups out of the box.
Relies on MongoDB 4.0.x, which is several versions behind current releases, potentially missing newer features, performance improvements, and security patches.