Skip to content

Commit

Permalink
Merge pull request #252 from jembi/fix-mongo-replication
Browse files Browse the repository at this point in the history
Fix mongo replication issue
  • Loading branch information
bradsawadye committed Sep 6, 2023
2 parents 93ae3a5 + d4b04b0 commit c6f479e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
projectName: platform
image: jembi/platform:2.4.2
image: jembi/platform:2.4.3
logPath: /tmp/logs

packages:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.9'

services:
await-helper:
image: jembi/await-helper:1.0.1
deploy:
replicas: 1
restart_policy:
condition: none
command: '-k http://mongo-1:27017'
2 changes: 2 additions & 0 deletions interoperability-layer-openhim/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function initialize_package() {
if [[ "${CLUSTERED_MODE}" == "true" ]]; then
try "${COMPOSE_FILE_PATH}/initiate-replica-set.sh $STACK" throw "Fatal: Initiate Mongo replica set failed"
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 \
mongo event listeners which only work with a replica set"
fi
Expand Down

0 comments on commit c6f479e

Please sign in to comment.