Skip to content

Commit

Permalink
Set the default mongo replication config
Browse files Browse the repository at this point in the history
This is so the host is specified and when the mongo service dies and is restored, the running node will always be the primary node, ensuring that we always have read and write access
  • Loading branch information
bradsawadye committed Nov 2, 2023
1 parent 2ca629f commit f6bd1de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interoperability-layer-openhim/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function initialize_package() {
else
config::await_service_running "mongo-1" "${COMPOSE_FILE_PATH}"/docker-compose.await-helper-mongo.yml "1" "$STACK"

try "docker exec -i $(docker ps -q -f name=openhim_mongo) mongo --eval \"rs.initiate()\"" throw "Could not initiate replica set for the single mongo instance. Some services use \
try "docker exec -i $(docker ps -q -f name=openhim_mongo) mongo --eval \"rs.initiate({'_id': 'mongo-set','members': [{'_id': 0,'priority': 1,'host': 'mongo-1:27017'}]})\"" throw "Could not initiate replica set for the single mongo instance. Some services use \
mongo event listeners which only work with a replica set"
fi
fi
Expand Down

0 comments on commit f6bd1de

Please sign in to comment.