diff --git a/.env.cluster b/.env.cluster index c3fd9d9e..961a1ac4 100644 --- a/.env.cluster +++ b/.env.cluster @@ -14,16 +14,16 @@ OPENHIM_CONSOLE_INSTANCES=3 OPENHIM_CORE_MEDIATOR_HOSTNAME=openhimcomms.domain OPENHIM_MEDIATOR_API_PORT=443 MONGO_SET_COUNT=3 -OPENHIM_MONGO_URL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set -OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set +OPENHIM_MONGO_URL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set +OPENHIM_MONGO_ATNAURL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set # FHIR Datastore - HAPI FHIR HAPI_FHIR_INSTANCES=3 -REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3 -POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432 +REPMGR_PARTNER_NODES=postgres-01,postgres-02,postgres-03 +POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432 # Sante Datastore - Sante MPI -REPMGR_PARTNER_NODES=santempi-psql-1,santempi-psql-2,santempi-psql-3 +REPMGR_PARTNER_NODES=santempi-psql-01,santempi-psql-02,santempi-psql-03 # Reverse Proxy - Nginx REVERSE_PROXY_INSTANCES=3 diff --git a/.env.remote b/.env.remote index a8af9218..3b5837af 100644 --- a/.env.remote +++ b/.env.remote @@ -7,7 +7,7 @@ OPENHIM_TRANSACTION_API_PORT= OPENHIM_MEDIATOR_API_PORT= MOCK_SERVER_HOST= MOCK_SERVER_PORT= -POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432 +POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432 # Analytics Datastore - Elastic Search ES_HOSTS="analytics-datastore-elastic-search-01:9200","analytics-datastore-elastic-search-02:9200","analytics-datastore-elastic-search-03:9200" @@ -16,13 +16,13 @@ ES_HOSTS="analytics-datastore-elastic-search-01:9200","analytics-datastore-elast CLICKHOUSE_HOST=analytics-datastore-clickhouse-01 # FHIR Datastore - HAPI FHIR -REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3 -POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432 +REPMGR_PARTNER_NODES=postgres-01,postgres-02,postgres-03 +POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432 # Interoperability Layer - OpenHIM MONGO_SET_COUNT=3 -OPENHIM_MONGO_URL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set -OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set +OPENHIM_MONGO_URL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set +OPENHIM_MONGO_ATNAURL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set # Message Bus - Kafka diff --git a/client-registry-santempi/docker-compose-postgres.cluster.yml b/client-registry-santempi/docker-compose-postgres.cluster.yml index 09d285ee..9b6fbcbf 100644 --- a/client-registry-santempi/docker-compose-postgres.cluster.yml +++ b/client-registry-santempi/docker-compose-postgres.cluster.yml @@ -1,44 +1,44 @@ version: '3.9' services: - santempi-psql-1: + santempi-psql-01: deploy: placement: constraints: - "node.labels.name==node-1" - santempi-psql-2: + santempi-psql-02: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME} - REPMGR_NODE_NETWORK_NAME: santempi-psql-2 + REPMGR_NODE_NETWORK_NAME: santempi-psql-02 REPMGR_PASSWORD: SanteDB123 REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: santempi-psql-2 + REPMGR_NODE_NAME: santempi-psql-02 REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES} volumes: - - 'santempi-psql-2-data:/bitnami/postgresql' + - 'santempi-psql-02-data:/bitnami/postgresql' deploy: replicas: 1 placement: constraints: - "node.labels.name==node-2" - santempi-psql-3: + santempi-psql-03: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME} - REPMGR_NODE_NETWORK_NAME: santempi-psql-3 + REPMGR_NODE_NETWORK_NAME: santempi-psql-03 REPMGR_PASSWORD: SanteDB123 REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: santempi-psql-3 + REPMGR_NODE_NAME: santempi-psql-03 REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES} volumes: - - 'santempi-psql-3-data:/bitnami/postgresql' + - 'santempi-psql-03-data:/bitnami/postgresql' deploy: replicas: 1 placement: @@ -46,5 +46,5 @@ services: - "node.labels.name==node-3" volumes: - santempi-psql-2-data: - santempi-psql-3-data: + santempi-psql-02-data: + santempi-psql-03-data: diff --git a/client-registry-santempi/docker-compose-postgres.dev.yml b/client-registry-santempi/docker-compose-postgres.dev.yml index 3bd2f578..c79a84b3 100644 --- a/client-registry-santempi/docker-compose-postgres.dev.yml +++ b/client-registry-santempi/docker-compose-postgres.dev.yml @@ -1,7 +1,7 @@ version: '3.9' services: - santempi-psql-1: + santempi-psql-01: ports: - target: 5432 published: 5433 diff --git a/client-registry-santempi/docker-compose-postgres.yml b/client-registry-santempi/docker-compose-postgres.yml index dc3626b2..2e00500f 100644 --- a/client-registry-santempi/docker-compose-postgres.yml +++ b/client-registry-santempi/docker-compose-postgres.yml @@ -1,21 +1,21 @@ version: '3.9' services: - santempi-psql-1: + santempi-psql-01: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME} - REPMGR_NODE_NETWORK_NAME: santempi-psql-1 + REPMGR_NODE_NETWORK_NAME: santempi-psql-01 REPMGR_PASSWORD: SanteDB123 REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: santempi-psql-1 + REPMGR_NODE_NAME: santempi-psql-01 REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES} volumes: - - 'santempi-psql-1-data:/bitnami/postgresql' + - 'santempi-psql-01-data:/bitnami/postgresql' deploy: replicas: 1 volumes: - santempi-psql-1-data: + santempi-psql-01-data: diff --git a/client-registry-santempi/package-metadata.json b/client-registry-santempi/package-metadata.json index bec377d2..0b18ffc9 100644 --- a/client-registry-santempi/package-metadata.json +++ b/client-registry-santempi/package-metadata.json @@ -10,7 +10,7 @@ "SANTEMPI_INSTANCES": "1", "SANTEMPI_POSTGRESQL_PASSWORD": "SanteDB123", "SANTEMPI_POSTGRESQL_USERNAME": "santedb", - "SANTEMPI_REPMGR_PRIMARY_HOST": "santempi-psql-1", - "SANTEMPI_REPMGR_PARTNER_NODES": "santempi-psql-1" + "SANTEMPI_REPMGR_PRIMARY_HOST": "santempi-psql-01", + "SANTEMPI_REPMGR_PARTNER_NODES": "santempi-psql-01" } } diff --git a/client-registry-santempi/swarm.sh b/client-registry-santempi/swarm.sh index d798ea5d..bd999600 100644 --- a/client-registry-santempi/swarm.sh +++ b/client-registry-santempi/swarm.sh @@ -19,14 +19,15 @@ function init_vars() { UTILS_PATH="${COMPOSE_FILE_PATH}/../utils" POSTGRES_SERVICES=( - "santempi-psql-1" + "santempi-psql-01" ) if [[ "${CLUSTERED_MODE}" == "true" ]]; then - POSTGRES_SERVICES=( - "${POSTGRES_SERVICES[@]}" - "santempi-psql-2" - "santempi-psql-3" - ) + for i in {2..3}; do + POSTGRES_SERVICES=( + "${POSTGRES_SERVICES[@]}" + "santempi-psql-0$i" + ) + done fi SERVICE_NAMES=( @@ -83,7 +84,7 @@ function initialize_package() { function destroy_package() { docker::service_destroy "${SERVICE_NAMES[@]}" - docker::try_remove_volume santedb-data santempi-psql-1-data + docker::try_remove_volume santedb-data santempi-psql-01-data if [[ "${CLUSTERED_MODE}" == "true" ]]; then log warn "Volumes are only deleted on the host on which the command is run. Postgres volumes on other nodes are not deleted" diff --git a/documentation/disaster-recovery-process/openhim-data.md b/documentation/disaster-recovery-process/openhim-data.md index 2e5c7bcf..4bd7e293 100644 --- a/documentation/disaster-recovery-process/openhim-data.md +++ b/documentation/disaster-recovery-process/openhim-data.md @@ -54,6 +54,6 @@ In order to restore from a backup you would need to launch a Mongo container wit Then exec into the container and run mongorestore: -`mongorestore --uri="mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/` +`mongorestore --uri="mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/` The data should be restored. diff --git a/documentation/packages/client-registry-santempi/environment-variables.md b/documentation/packages/client-registry-santempi/environment-variables.md index dd3d60f1..3d4ef956 100644 --- a/documentation/packages/client-registry-santempi/environment-variables.md +++ b/documentation/packages/client-registry-santempi/environment-variables.md @@ -11,8 +11,8 @@ description: Listed in this page are all environment variables needed to run Kib | SANTEMPI\_AUDIT\_CONNECTION\_STRING | String | Audit connection string to SanteMPI | No | _Check below table_ | | SANTEMPI\_POSTGRESQL\_PASSWORD | String | SanteMPI postgreSQL password | No | SanteDB123 | | SANTEMPI\_POSTGRESQL\_USERNAME | String | SanteMPI postgreSQL username | No | santempi | -| SANTEMPI\_REPMGR\_PRIMARY\_HOST | String | SanteMPI postgreSQL replicas manager primary host | No | santempi-psql-1 | -| SANTEMPI\_REPMGR\_PARTNER\_NODES | String | SanteMPI postgreSQL replicas manager nodes hosts | Yes | santempi-psql-1,santempi-psql-2,santempi-psql- | +| SANTEMPI\_REPMGR\_PRIMARY\_HOST | String | SanteMPI postgreSQL replicas manager primary host | No | santempi-psql-01 | +| SANTEMPI\_REPMGR\_PARTNER\_NODES | String | SanteMPI postgreSQL replicas manager nodes hosts | Yes | santempi-psql-01,santempi-psql-02,santempi-psql- | ### Note @@ -21,11 +21,11 @@ The environment variable `SANTEMPI_REPMGR_PARTNER_NODES` will differ from cluste Default value for `SANTEMPI_MAIN_CONNECTION_STRING`: ``` -server=santempi-psql-1;port=5432; database=santedb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60; +server=santempi-psql-01;port=5432; database=santedb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60; ``` Default value for `SANTEMPI_AUDIT_CONNECTION_STRING`: ``` -server=santempi-psql-1;port=5432; database=auditdb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60; +server=santempi-psql-01;port=5432; database=auditdb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60; ``` diff --git a/documentation/packages/fhir-datastore-hapi-fhir/environment-variables.md b/documentation/packages/fhir-datastore-hapi-fhir/environment-variables.md index 9a3d8074..a7b92eac 100644 --- a/documentation/packages/fhir-datastore-hapi-fhir/environment-variables.md +++ b/documentation/packages/fhir-datastore-hapi-fhir/environment-variables.md @@ -8,9 +8,9 @@ description: >- | Variable Name | Type | Revelance | Required | Default | | ----------------------------- | ------ | ----------------------------------------------------------------- | -------- | --------------- | -| REPMGR\_PRIMARY\_HOST | String | Service name of the primary replication manager host (PostgreSQL) | No | postgres-1 | -| REPMGR\_PARTNER\_NODES | String | Service names of the replicas of PostgreSQL | Yes | postgres-1 | -| POSTGRES\_REPLICA\_SET | String | PostgreSQL replica set (host and port of the replicas) | Yes | postgres-1:5432 | +| REPMGR\_PRIMARY\_HOST | String | Service name of the primary replication manager host (PostgreSQL) | No | postgres-01 | +| REPMGR\_PARTNER\_NODES | String | Service names of the replicas of PostgreSQL | Yes | postgres-01 | +| POSTGRES\_REPLICA\_SET | String | PostgreSQL replica set (host and port of the replicas) | Yes | postgres-01:5432 | | HAPI\_FHIR\_CPU\_LIMIT | Number | CPU limit usage for hapi-fhir service | No | 0 (unlimited) | | HAPI\_FHIR\_CPU\_RESERVE | Number | Reserved CPU usage for hapi-fhir service | No | 0.05 | | HAPI\_FHIR\_MEMORY\_LIMIT | String | RAM limit usage for hapi-fhir service | No | 3G | diff --git a/documentation/packages/interoperability-layer-openhim/environment-variables.md b/documentation/packages/interoperability-layer-openhim/environment-variables.md index c50b040a..d954b76d 100644 --- a/documentation/packages/interoperability-layer-openhim/environment-variables.md +++ b/documentation/packages/interoperability-layer-openhim/environment-variables.md @@ -12,8 +12,8 @@ description: >- | OPENHIM\_MEDIATOR\_API\_PORT | Number | Port of the Openhim mediator | Yes | 8080 | | OPENHIM\_CORE\_INSTANCES | Number | Number of openhim-core instances | No | 1 | | OPENHIM\_CONSOLE\_INSTANCES | String | Number of openhim-console instances | No | 1 | -| OPENHIM\_MONGO\_URL | String | MongoDB connection string | Yes | mongodb://mongo-1:27017/openhim | -| OPENHIM\_MONGO\_ATNAURL | String | ??????????? | Yes | mongodb://mongo-1:27017/openhim | +| OPENHIM\_MONGO\_URL | String | MongoDB connection string | Yes | mongodb://mongo-01:27017/openhim | +| OPENHIM\_MONGO\_ATNAURL | String | ??????????? | Yes | mongodb://mongo-01:27017/openhim | | OPENHIM\_CPU\_LIMIT | Number | CPU limit usage for openhim-core | No | 0 | | OPENHIM\_CPU\_RESERVE | Number | Reserverd CPU usage for openhim-core | No | 0.05 | | OPENHIM\_MEMORY\_LIMIT | String | RAM usage limit for openhim-core | No | 3G | diff --git a/fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml b/fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml index 9620e665..c060a6c8 100644 --- a/fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml +++ b/fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml @@ -1,7 +1,7 @@ version: '3.9' services: - postgres-1: + postgres-01: environment: REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES} deploy: @@ -9,20 +9,20 @@ services: constraints: - "node.labels.name==node-1" - postgres-2: + postgres-02: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME} POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE} - REPMGR_NODE_NETWORK_NAME: postgres-2 + REPMGR_NODE_NETWORK_NAME: postgres-02 REPMGR_PASSWORD: ${REPMGR_PASSWORD} REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: postgres-2 + REPMGR_NODE_NAME: postgres-02 REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES} volumes: - - 'hapi-postgres-2-data:/bitnami/postgresql' + - 'hapi-postgres-02-data:/bitnami/postgresql' deploy: placement: constraints: @@ -39,21 +39,20 @@ services: default: pg_backup_net: {} - - postgres-3: + postgres-03: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME} POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE} - REPMGR_NODE_NETWORK_NAME: postgres-3 + REPMGR_NODE_NETWORK_NAME: postgres-03 REPMGR_PASSWORD: ${REPMGR_PASSWORD} REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: postgres-3 + REPMGR_NODE_NAME: postgres-03 REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES} volumes: - - 'hapi-postgres-3-data:/bitnami/postgresql' + - 'hapi-postgres-03-data:/bitnami/postgresql' deploy: placement: constraints: @@ -70,7 +69,6 @@ services: default: pg_backup_net: {} - volumes: - hapi-postgres-2-data: - hapi-postgres-3-data: + hapi-postgres-02-data: + hapi-postgres-03-data: diff --git a/fhir-datastore-hapi-fhir/docker-compose-postgres.dev.yml b/fhir-datastore-hapi-fhir/docker-compose-postgres.dev.yml index 292eb9b5..e306d7b3 100644 --- a/fhir-datastore-hapi-fhir/docker-compose-postgres.dev.yml +++ b/fhir-datastore-hapi-fhir/docker-compose-postgres.dev.yml @@ -1,7 +1,7 @@ version: '3.9' services: - postgres-1: + postgres-01: ports: - target: 5432 published: 5432 diff --git a/fhir-datastore-hapi-fhir/docker-compose-postgres.yml b/fhir-datastore-hapi-fhir/docker-compose-postgres.yml index 0448fc1a..1248ef33 100644 --- a/fhir-datastore-hapi-fhir/docker-compose-postgres.yml +++ b/fhir-datastore-hapi-fhir/docker-compose-postgres.yml @@ -1,21 +1,21 @@ version: "3.9" services: - postgres-1: + postgres-01: image: bitnami/postgresql-repmgr:14 environment: POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD} POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME} POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE} - REPMGR_NODE_NETWORK_NAME: postgres-1 + REPMGR_NODE_NETWORK_NAME: postgres-01 REPMGR_PASSWORD: ${REPMGR_PASSWORD} REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: postgres-1 + REPMGR_NODE_NAME: postgres-01 REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST} REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES} POSTGRESQL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD} volumes: - - "hapi-postgres-1-data:/bitnami/postgresql" + - "hapi-postgres-01-data:/bitnami/postgresql" deploy: replicas: 1 resources: @@ -30,7 +30,8 @@ services: pg_backup_net: {} volumes: - hapi-postgres-1-data: + hapi-postgres-01-data: + networks: default: diff --git a/fhir-datastore-hapi-fhir/package-metadata.json b/fhir-datastore-hapi-fhir/package-metadata.json index af571673..53dc24b4 100644 --- a/fhir-datastore-hapi-fhir/package-metadata.json +++ b/fhir-datastore-hapi-fhir/package-metadata.json @@ -7,15 +7,15 @@ "dependencies": [], "environmentVariables": { "CLUSTERED_MODE": "false", - "REPMGR_PRIMARY_HOST": "postgres-1", - "REPMGR_PARTNER_NODES": "postgres-1", + "REPMGR_PRIMARY_HOST": "postgres-01", + "REPMGR_PARTNER_NODES": "postgres-01", "REPMGR_PASSWORD": "instant101", "HAPI_FHIR_INSTANCES": "1", "HAPI_FHIR_CPU_LIMIT": "0", "HAPI_FHIR_CPU_RESERVE": "0.05", "HAPI_FHIR_MEMORY_LIMIT": "3G", "HAPI_FHIR_MEMORY_RESERVE": "500M", - "POSTGRES_REPLICA_SET": "postgres-1:5432", + "POSTGRES_REPLICA_SET": "postgres-01:5432", "HAPI_POSTGRES_PASSWORD": "postgres", "HF_POSTGRES_CPU_LIMIT": "0", "HF_POSTGRES_CPU_RESERVE": "0.05", diff --git a/fhir-datastore-hapi-fhir/swarm.sh b/fhir-datastore-hapi-fhir/swarm.sh index 8874c0b1..45ae3eff 100644 --- a/fhir-datastore-hapi-fhir/swarm.sh +++ b/fhir-datastore-hapi-fhir/swarm.sh @@ -19,13 +19,13 @@ function init_vars() { UTILS_PATH="${COMPOSE_FILE_PATH}/../utils" POSTGRES_SERVICES=( - "postgres-1" + "postgres-01" ) if [[ "${CLUSTERED_MODE}" == "true" ]]; then for i in {2..3}; do POSTGRES_SERVICES=( "${POSTGRES_SERVICES[@]}" - "postgres-$i" + "postgres-0$i" ) done fi @@ -83,7 +83,7 @@ function initialize_package() { function destroy_package() { docker::service_destroy "${SERVICE_NAMES[@]}" - docker::try_remove_volume hapi-postgres-1-data + docker::try_remove_volume hapi-postgres-01-data if [[ "${CLUSTERED_MODE}" == "true" ]]; then log warn "Volumes are only deleted on the host on which the command is run. Postgres volumes on other nodes are not deleted" diff --git a/interoperability-layer-openhim/README.md b/interoperability-layer-openhim/README.md index 7af7481b..f21a6645 100644 --- a/interoperability-layer-openhim/README.md +++ b/interoperability-layer-openhim/README.md @@ -63,4 +63,4 @@ In order to restore from a backup you would need to launch a mongo container wit Then exec into the container and run mongorestore: -`mongorestore --uri="mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/` +`mongorestore --uri="mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/` diff --git a/interoperability-layer-openhim/docker-compose-mongo.cluster.yml b/interoperability-layer-openhim/docker-compose-mongo.cluster.yml index 42b47cbc..ee39dece 100644 --- a/interoperability-layer-openhim/docker-compose-mongo.cluster.yml +++ b/interoperability-layer-openhim/docker-compose-mongo.cluster.yml @@ -1,18 +1,30 @@ version: '3.9' services: - mongo-1: - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + mongo-01: + command: + [ + '--replSet', + 'mongo-set', + '--wiredTigerCacheSizeGB', + '0.5' + ] deploy: placement: constraints: - "node.labels.name==node-1" - mongo-2: + mongo-02: image: mongo:4.2 volumes: - 'openhim-mongo-02:/data/db' - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + command: + [ + '--replSet', + 'mongo-set', + '--wiredTigerCacheSizeGB', + '0.5' + ] deploy: placement: constraints: @@ -29,11 +41,17 @@ services: default: mongo_backup_net: {} - mongo-3: + mongo-03: image: mongo:4.2 volumes: - 'openhim-mongo-03:/data/db' - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + command: + [ + '--replSet', + 'mongo-set', + '--wiredTigerCacheSizeGB', + '0.5' + ] deploy: placement: constraints: diff --git a/interoperability-layer-openhim/docker-compose-mongo.dev.yml b/interoperability-layer-openhim/docker-compose-mongo.dev.yml index 84f57b68..7889f9bf 100644 --- a/interoperability-layer-openhim/docker-compose-mongo.dev.yml +++ b/interoperability-layer-openhim/docker-compose-mongo.dev.yml @@ -1,7 +1,7 @@ version: '3.9' services: - mongo-1: + mongo-01: ports: - target: 27017 published: 27017 diff --git a/interoperability-layer-openhim/docker-compose-mongo.yml b/interoperability-layer-openhim/docker-compose-mongo.yml index 5a010bcc..26c8fb50 100644 --- a/interoperability-layer-openhim/docker-compose-mongo.yml +++ b/interoperability-layer-openhim/docker-compose-mongo.yml @@ -1,7 +1,7 @@ version: "3.9" services: - mongo-1: + mongo-01: image: mongo:4.2 volumes: - "openhim-mongo-01:/data/db" diff --git a/interoperability-layer-openhim/initiate-replica-set.sh b/interoperability-layer-openhim/initiate-replica-set.sh index cd6e8604..a05dfac0 100755 --- a/interoperability-layer-openhim/initiate-replica-set.sh +++ b/interoperability-layer-openhim/initiate-replica-set.sh @@ -15,8 +15,8 @@ MONGO_SET_COUNT=${MONGO_SET_COUNT:-3} config='{"_id":"mongo-set","members":[' priority="1" for i in $(seq 1 "$MONGO_SET_COUNT"); do - config=$(printf '%s{"_id":%s,"priority":%s,"host":"mongo-%s:27017"}' "$config" $((i - 1)) $priority "$i") - if [[ $i != $MONGO_SET_COUNT ]]; then + config=$(printf '%s{"_id":%s,"priority":%s,"host":"mongo-0%s:27017"}' "$config" $((i - 1)) $priority "$i") + if [[ $i != "$MONGO_SET_COUNT" ]]; then config=$(printf '%s,' "$config") fi priority="0.5" @@ -41,7 +41,7 @@ done # Ensures that the replica sets are reachable reachable_instance_count=1 until [[ $reachable_instance_count -eq $((MONGO_SET_COUNT + 1)) ]]; do - config::await_service_reachable "mongo-$reachable_instance_count" "waiting for connections on port" + config::await_service_reachable "mongo-0$reachable_instance_count" "waiting for connections on port" reachable_instance_count=$((reachable_instance_count + 1)) done @@ -49,8 +49,8 @@ done # With docker swarm any manager can be the target but this bit of code only work if we target node-1 specifically. # Which is generally what we do, but if node-1 is down or we choose to target another node this won't work. container_name="" -if [[ "$(docker ps -f name=instant_mongo-1 --format "{{.ID}}")" ]]; then - container_name="$(docker ps -f name=instant_mongo-1 --format "{{.ID}}")" +if [[ "$(docker ps -f name=instant_mongo-01 --format "{{.ID}}")" ]]; then + container_name="$(docker ps -f name=instant_mongo-01 --format "{{.ID}}")" fi initiate_rep_set_response=$(docker exec -i "$container_name" mongo --eval "rs.initiate($config)") diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index f969c6d5..6f84a640 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -24,7 +24,7 @@ "OPENHIM_MONGO_CPU_RESERVE": "0.05", "OPENHIM_MONGO_MEMORY_LIMIT": "2G", "OPENHIM_MONGO_MEMORY_RESERVE": "500M", - "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim", - "OPENHIM_MONGO_ATNAURL": "mongodb://mongo-1:27017/openhim" + "OPENHIM_MONGO_URL": "mongodb://mongo-01:27017/openhim", + "OPENHIM_MONGO_ATNAURL": "mongodb://mongo-01:27017/openhim" } } diff --git a/interoperability-layer-openhim/swarm.sh b/interoperability-layer-openhim/swarm.sh index cc47a4a8..695278db 100644 --- a/interoperability-layer-openhim/swarm.sh +++ b/interoperability-layer-openhim/swarm.sh @@ -25,13 +25,13 @@ function init_vars() { ) MONGO_SERVICES=( - "mongo-1" + "mongo-01" ) if [[ "${CLUSTERED_MODE}" == "true" ]]; then for i in {2..3}; do MONGO_SERVICES=( "${MONGO_SERVICES[@]}" - "mongo-$i" + "mongo-0$i" ) done fi diff --git a/job-scheduler-ofelia/package-metadata.json b/job-scheduler-ofelia/package-metadata.json index 389e4711..bf0ab8f2 100644 --- a/job-scheduler-ofelia/package-metadata.json +++ b/job-scheduler-ofelia/package-metadata.json @@ -10,6 +10,6 @@ "STAGING": "true", "DOMAIN_NAME": "localhost", "SUBDOMAINS": "", - "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim" + "OPENHIM_MONGO_URL": "mongodb://mongo-01:27017/openhim" } } diff --git a/message-bus-kafka/docker-compose.cluster.kafka-zoo.yml b/message-bus-kafka/docker-compose.cluster.kafka-zoo.yml index c1df63ff..56b7c0fd 100644 --- a/message-bus-kafka/docker-compose.cluster.kafka-zoo.yml +++ b/message-bus-kafka/docker-compose.cluster.kafka-zoo.yml @@ -1,10 +1,10 @@ version: '3.9' services: - zookeeper-1: + zookeeper-01: environment: - ZOO_SERVER_ID=1 - - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-2:2888:3888,zookeeper-3:2888:3888 + - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-02:2888:3888,zookeeper-03:2888:3888 deploy: placement: constraints: @@ -17,14 +17,14 @@ services: cpus: ${ZOOKEEPER_CPU_RESERVE} memory: ${ZOOKEEPER_MEMORY_RESERVE} - zookeeper-2: + zookeeper-02: image: bitnami/zookeeper:3.7.0 environment: - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_SERVER_ID=2 - - ZOO_SERVERS=zookeeper-1:2888:3888,0.0.0.0:2888:3888,zookeeper-3:2888:3888 + - ZOO_SERVERS=zookeeper-01:2888:3888,0.0.0.0:2888:3888,zookeeper-03:2888:3888 volumes: - - zookeeper-2-volume:/bitnami/zookeeper + - zookeeper-02-volume:/bitnami/zookeeper deploy: placement: constraints: @@ -37,14 +37,14 @@ services: cpus: ${ZOOKEEPER_CPU_RESERVE} memory: ${ZOOKEEPER_MEMORY_RESERVE} - zookeeper-3: + zookeeper-03: image: bitnami/zookeeper:3.7.0 environment: - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_SERVER_ID=3 - - ZOO_SERVERS=zookeeper-1:2888:3888,zookeeper-2:2888:3888,0.0.0.0:2888:3888 + - ZOO_SERVERS=zookeeper-01:2888:3888,zookeeper-02:2888:3888,0.0.0.0:2888:3888 volumes: - - zookeeper-3-volume:/bitnami/zookeeper + - zookeeper-03-volume:/bitnami/zookeeper deploy: placement: constraints: @@ -58,5 +58,5 @@ services: memory: ${ZOOKEEPER_MEMORY_RESERVE} volumes: - zookeeper-2-volume: - zookeeper-3-volume: + zookeeper-02-volume: + zookeeper-03-volume: diff --git a/message-bus-kafka/docker-compose.cluster.kafka.yml b/message-bus-kafka/docker-compose.cluster.kafka.yml index 9ada0909..0236f109 100644 --- a/message-bus-kafka/docker-compose.cluster.kafka.yml +++ b/message-bus-kafka/docker-compose.cluster.kafka.yml @@ -4,7 +4,7 @@ services: kafka: hostname: kafka-{{.Node.Hostname}} environment: - - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-01:2181,zookeeper-02:2181,zookeeper-03:2181 deploy: placement: max_replicas_per_node: 1 diff --git a/message-bus-kafka/docker-compose.kafka-zoo.yml b/message-bus-kafka/docker-compose.kafka-zoo.yml index 17a20e64..590a068e 100644 --- a/message-bus-kafka/docker-compose.kafka-zoo.yml +++ b/message-bus-kafka/docker-compose.kafka-zoo.yml @@ -1,12 +1,12 @@ version: '3.9' services: - zookeeper-1: + zookeeper-01: image: bitnami/zookeeper:3.7.0 environment: - ALLOW_ANONYMOUS_LOGIN=yes volumes: - - zookeeper-1-volume:/bitnami/zookeeper + - zookeeper-01-volume:/bitnami/zookeeper deploy: resources: limits: @@ -17,4 +17,4 @@ services: memory: ${ZOOKEEPER_MEMORY_RESERVE} volumes: - zookeeper-1-volume: + zookeeper-01-volume: diff --git a/message-bus-kafka/docker-compose.kafka.yml b/message-bus-kafka/docker-compose.kafka.yml index 6051bbb7..dab1427d 100644 --- a/message-bus-kafka/docker-compose.kafka.yml +++ b/message-bus-kafka/docker-compose.kafka.yml @@ -5,7 +5,7 @@ services: image: bitnami/kafka:3.1.0 hostname: kafka environment: - - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-1:2181 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-01:2181 - ALLOW_PLAINTEXT_LISTENER=yes - KAFKA_CFG_MESSAGE_MAX_BYTES=10485760 - KAFKA_CFG_SOCKET_REQUEST_MAX_BYTES=20971520 diff --git a/message-bus-kafka/swarm.sh b/message-bus-kafka/swarm.sh index 8f6530cd..32c1ac5f 100755 --- a/message-bus-kafka/swarm.sh +++ b/message-bus-kafka/swarm.sh @@ -19,21 +19,21 @@ function init_vars() { UTILS_PATH="${COMPOSE_FILE_PATH}/../utils" - ZOOKEEPER_SERVICES=( - "zookeeper-1" - ) - UTILS_SERVICES=( "kafdrop" "kafka-minion" ) + ZOOKEEPER_SERVICES=( + "zookeeper-01" + ) if [[ "${CLUSTERED_MODE}" == "true" ]]; then - ZOOKEEPER_SERVICES=( - "${ZOOKEEPER_SERVICES[@]}" - "zookeeper-2" - "zookeeper-3" - ) + for i in {2..3}; do + ZOOKEEPER_SERVICES=( + "${ZOOKEEPER_SERVICES[@]}" + "zookeeper-0$i" + ) + done fi SERVICE_NAMES=( @@ -106,7 +106,7 @@ function initialize_package() { function destroy_package() { docker::service_destroy "${SERVICE_NAMES[@]}" "message-bus-kafka-config-importer" - docker::try_remove_volume zookeeper-1-volume kafka-volume + docker::try_remove_volume zookeeper-01-volume kafka-volume if [[ "$CLUSTERED_MODE" == "true" ]]; then log warn "Volumes are only deleted on the host on which the command is run. Cluster volumes on other nodes are not deleted"