Run rs.initiate() to start replication on clean mongo boot #6317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves reactioncommerce/reaction-development-platform#165
Impact: major
Type: bugfix
Issue
On the initial load of the mongod if started in replica,
rs.initiate()
has to be run on one of the instance to start the replication. This was missing from our configuration files.Solution
Using
healthcheck
option of the docker-compose to hack docker running the rs.initiate() command. Used this for reference: https://zgadzaj.com/development/docker/docker-compose/turning-standalone-mongodb-server-into-a-replica-set-with-docker-composeBreaking changes
None expected.
Testing
make clean
make init-dev
Would love to have a couple of eyes on this one and discuss if there could be a better solution on this one. Most of the resources day that
rs.initiate()
should be run manually based on need, but in our use case, we are using replication more for oplog than for actual replication.