Skip to content

Commit c6f479e

Browse files
authored
Merge pull request #252 from jembi/fix-mongo-replication
Fix mongo replication issue
2 parents 93ae3a5 + d4b04b0 commit c6f479e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
projectName: platform
2-
image: jembi/platform:2.4.2
2+
image: jembi/platform:2.4.3
33
logPath: /tmp/logs
44

55
packages:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.9'
2+
3+
services:
4+
await-helper:
5+
image: jembi/await-helper:1.0.1
6+
deploy:
7+
replicas: 1
8+
restart_policy:
9+
condition: none
10+
command: '-k http://mongo-1:27017'

interoperability-layer-openhim/swarm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ function initialize_package() {
5555
if [[ "${CLUSTERED_MODE}" == "true" ]]; then
5656
try "${COMPOSE_FILE_PATH}/initiate-replica-set.sh $STACK" throw "Fatal: Initiate Mongo replica set failed"
5757
else
58+
config::await_service_running "mongo-1" "${COMPOSE_FILE_PATH}"/docker-compose.await-helper-mongo.yml "1" "$STACK"
59+
5860
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 \
5961
mongo event listeners which only work with a replica set"
6062
fi

0 commit comments

Comments
 (0)