autopilotpattern / mongodb

A robust and highly-scalable implementation of MongoDB in Docker using the Autopilot Pattern
Mozilla Public License 2.0
42 stars 20 forks source link

AutoPilot Pattern MongoDB

A robust and highly-scalable implementation of MongoDB in Docker using the Autopilot Pattern

Architecture

A running cluster includes the following components:

Running the cluster

Starting a new cluster is easy once you have your _env file set with the configuration details

In a few moments you'll have a running MongoDB ready for a replica set. Both the master and replicas are described as a single docker-compose service. During startup, ContainerPilot will ask Consul if an existing master has been created. If not, the node will initialize as a new MongoDB replica set and all future nodes will be added to the replica set by the current master. All master election is handled by MongoDB itself and the result is cached in Consul.

Run docker-compose -f local-compose.yml scale mongodb=2 to add a replica (or more than one!). The replicas will automatically be added to the replica set on the master and will register themselves in Consul as replicas once they're ready.

Configuration

Pass these variables via an _env file.

Not yet implemented:

Sponsors

Initial development of this project was sponsored by Joyent.