Skip to content

Commit 2d2d10d

Browse files
authored
Merge pull request #249 from jembi/hotfix-hapi-fhir-tag-fixing
Hotfix: hapi fhir tag fixing
2 parents 8f6b5ca + 51da35e commit 2d2d10d

File tree

11 files changed

+170
-136
lines changed

11 files changed

+170
-136
lines changed

.env.cluster

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhi
1919

2020
# FHIR Datastore - HAPI FHIR
2121
HAPI_FHIR_INSTANCES=3
22+
# (pool size * instances) should be less than 100
23+
HF_MAX_POOL_SIZE=30
2224
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
2325
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
2426
HAPI_DB_SET=pgpool-1:5432,pgpool-2:5432,pgpool-3:5432

.env.remote

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ES_HOSTS="\"analytics-datastore-elastic-search-01:9200","analytics-datastore-ela
1515
CLICKHOUSE_HOST=analytics-datastore-clickhouse-01
1616

1717
# FHIR Datastore - HAPI FHIR
18+
HAPI_FHIR_INSTANCES=3
19+
HF_MAX_POOL_SIZE=30
1820
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
1921
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
2022
HAPI_DB_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432

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.1
2+
image: jembi/platform:2.4.2
33
logPath: /tmp/logs
44

55
packages:

fhir-datastore-hapi-fhir/config/custom_pgpool.conf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
failover_on_backend_error='on'
2-
detach_false_primary='on'
31
auto_failback='on'
42
health_check_period=25
53
health_check_max_retries=3
64
health_check_user='postgres'
7-
reserved_connections=1
8-
max_pool=6
5+
max_pool=5
96
client_idle_limit=300
10-
connection_life_time=300
11-
child_max_connections=25
127

138
use_watchdog='on'
149
hostname0='pgpool-1'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
max_connections = 250
2+
shared_buffers = 768MB
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
version: '3.9'
2+
3+
services:
4+
pgpool-1:
5+
image: bitnami/pgpool:4.4.3
6+
deploy:
7+
placement:
8+
constraints:
9+
- "node.labels.name==node-1"
10+
replicas: 1
11+
resources:
12+
limits:
13+
cpus: ${HF_PGPOOL_CPU_LIMIT}
14+
memory: ${HF_PGPOOL_MEMORY_LIMIT}
15+
reservations:
16+
cpus: ${HF_PGPOOL_CPU_RESERVE}
17+
memory: ${HF_PGPOOL_MEMORY_RESERVE}
18+
configs:
19+
- target: /config/custom_pgpool.conf
20+
source: pgpool.conf
21+
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
22+
source: pgpool_node_id0.conf
23+
environment:
24+
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
25+
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
26+
PGPOOL_SR_CHECK_USER: postgres
27+
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
28+
PGPOOL_POSTGRES_USERNAME: postgres
29+
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
30+
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
31+
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
32+
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
33+
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
34+
PGPOOL_ENABLE_LOAD_BALANCING: "no"
35+
PGPOOL_AUTO_FAILBACK: "yes"
36+
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
37+
38+
pgpool-2:
39+
image: bitnami/pgpool:4.4.3
40+
deploy:
41+
placement:
42+
constraints:
43+
- "node.labels.name==node-2"
44+
replicas: 1
45+
resources:
46+
limits:
47+
cpus: ${HF_PGPOOL_CPU_LIMIT}
48+
memory: ${HF_PGPOOL_MEMORY_LIMIT}
49+
reservations:
50+
cpus: ${HF_PGPOOL_CPU_RESERVE}
51+
memory: ${HF_PGPOOL_MEMORY_RESERVE}
52+
configs:
53+
- target: /config/custom_pgpool.conf
54+
source: pgpool.conf
55+
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
56+
source: pgpool_node_id1.conf
57+
environment:
58+
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
59+
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
60+
PGPOOL_SR_CHECK_USER: postgres
61+
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
62+
PGPOOL_POSTGRES_USERNAME: postgres
63+
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
64+
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
65+
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
66+
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
67+
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
68+
PGPOOL_ENABLE_LOAD_BALANCING: "no"
69+
PGPOOL_AUTO_FAILBACK: "yes"
70+
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
71+
72+
pgpool-3:
73+
image: bitnami/pgpool:4.4.3
74+
deploy:
75+
placement:
76+
constraints:
77+
- "node.labels.name==node-3"
78+
replicas: 1
79+
resources:
80+
limits:
81+
cpus: ${HF_PGPOOL_CPU_LIMIT}
82+
memory: ${HF_PGPOOL_MEMORY_LIMIT}
83+
reservations:
84+
cpus: ${HF_PGPOOL_CPU_RESERVE}
85+
memory: ${HF_PGPOOL_MEMORY_RESERVE}
86+
configs:
87+
- target: /config/custom_pgpool.conf
88+
source: pgpool.conf
89+
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
90+
source: pgpool_node_id2.conf
91+
environment:
92+
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
93+
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
94+
PGPOOL_SR_CHECK_USER: postgres
95+
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
96+
PGPOOL_POSTGRES_USERNAME: postgres
97+
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
98+
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
99+
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
100+
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
101+
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
102+
PGPOOL_ENABLE_LOAD_BALANCING: "no"
103+
PGPOOL_AUTO_FAILBACK: "yes"
104+
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
105+
106+
configs:
107+
pgpool.conf:
108+
name: pgpool_conf-${pgpool_conf_DIGEST:?err}
109+
file: ./config/custom_pgpool.conf
110+
labels:
111+
name: hapi-fhir
112+
pgpool_node_id0.conf:
113+
name: pgpool_node_id0-${pgpool_node_id0_DIGEST:?err}
114+
file: ./config/pgpool_node_id0
115+
labels:
116+
name: hapi-fhir
117+
pgpool_node_id1.conf:
118+
name: pgpool_node_id1-${pgpool_node_id1_DIGEST:?err}
119+
file: ./config/pgpool_node_id1
120+
labels:
121+
name: hapi-fhir
122+
pgpool_node_id2.conf:
123+
name: pgpool_node_id2-${pgpool_node_id2_DIGEST:?err}
124+
file: ./config/pgpool_node_id2
125+
labels:
126+
name: hapi-fhir

fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml

Lines changed: 10 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ services:
2222
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
2323
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
2424
POSTGRESQL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
25+
REPMGR_FAILOVER: ${HF_POSTGRES_FAILOVER}
26+
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${HF_POSTGRES_DEGRADED_MONITORING_TIMEOUT}
2527
volumes:
2628
- 'hapi-postgres-2-data:/bitnami/postgresql'
29+
configs:
30+
- target: /bitnami/postgresql/conf/conf.d/custom_postgresql.conf
31+
source: postgresql.conf
2732
deploy:
2833
placement:
2934
constraints:
@@ -53,8 +58,13 @@ services:
5358
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
5459
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
5560
POSTGRESQL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
61+
REPMGR_FAILOVER: ${HF_POSTGRES_FAILOVER}
62+
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${HF_POSTGRES_DEGRADED_MONITORING_TIMEOUT}
5663
volumes:
5764
- 'hapi-postgres-3-data:/bitnami/postgresql'
65+
configs:
66+
- target: /bitnami/postgresql/conf/conf.d/custom_postgresql.conf
67+
source: postgresql.conf
5868
deploy:
5969
placement:
6070
constraints:
@@ -71,130 +81,6 @@ services:
7181
default:
7282
pg_backup_net:
7383

74-
pgpool-1:
75-
image: bitnami/pgpool:4.4.3
76-
deploy:
77-
placement:
78-
max_replicas_per_node: 1
79-
resources:
80-
limits:
81-
cpus: ${HF_PGPOOL_CPU_LIMIT}
82-
memory: ${HF_PGPOOL_MEMORY_LIMIT}
83-
reservations:
84-
cpus: ${HF_PGPOOL_CPU_RESERVE}
85-
memory: ${HF_PGPOOL_MEMORY_RESERVE}
86-
configs:
87-
- target: /config/custom_pgpool.conf
88-
source: pgpool.conf
89-
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
90-
source: pgpool_node_id0.conf
91-
environment:
92-
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
93-
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
94-
PGPOOL_SR_CHECK_USER: postgres
95-
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
96-
PGPOOL_POSTGRES_USERNAME: postgres
97-
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
98-
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
99-
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
100-
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
101-
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
102-
PGPOOL_ENABLE_LOAD_BALANCING: "no"
103-
PGPOOL_AUTO_FAILBACK: "yes"
104-
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
105-
networks:
106-
default:
107-
108-
pgpool-2:
109-
image: bitnami/pgpool:4.4.3
110-
deploy:
111-
placement:
112-
max_replicas_per_node: 1
113-
resources:
114-
limits:
115-
cpus: ${HF_PGPOOL_CPU_LIMIT}
116-
memory: ${HF_PGPOOL_MEMORY_LIMIT}
117-
reservations:
118-
cpus: ${HF_PGPOOL_CPU_RESERVE}
119-
memory: ${HF_PGPOOL_MEMORY_RESERVE}
120-
configs:
121-
- target: /config/custom_pgpool.conf
122-
source: pgpool.conf
123-
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
124-
source: pgpool_node_id1.conf
125-
environment:
126-
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
127-
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
128-
PGPOOL_SR_CHECK_USER: postgres
129-
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
130-
PGPOOL_POSTGRES_USERNAME: postgres
131-
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
132-
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
133-
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
134-
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
135-
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
136-
PGPOOL_ENABLE_LOAD_BALANCING: "no"
137-
PGPOOL_AUTO_FAILBACK: "yes"
138-
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
139-
networks:
140-
default:
141-
142-
pgpool-3:
143-
image: bitnami/pgpool:4.4.3
144-
deploy:
145-
placement:
146-
max_replicas_per_node: 1
147-
resources:
148-
limits:
149-
cpus: ${HF_PGPOOL_CPU_LIMIT}
150-
memory: ${HF_PGPOOL_MEMORY_LIMIT}
151-
reservations:
152-
cpus: ${HF_PGPOOL_CPU_RESERVE}
153-
memory: ${HF_PGPOOL_MEMORY_RESERVE}
154-
configs:
155-
- target: /config/custom_pgpool.conf
156-
source: pgpool.conf
157-
- target: /opt/bitnami/pgpool/conf/pgpool_node_id
158-
source: pgpool_node_id2.conf
159-
environment:
160-
PGPOOL_BACKEND_NODES: ${HF_PGPOOL_NODES}
161-
PGPOOL_BACKEND_APPLICATION_NAMES: ${REPMGR_PARTNER_NODES}
162-
PGPOOL_SR_CHECK_USER: postgres
163-
PGPOOL_SR_CHECK_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
164-
PGPOOL_POSTGRES_USERNAME: postgres
165-
PGPOOL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
166-
PGPOOL_ADMIN_USERNAME: ${HF_PGPOOL_USERNAME}
167-
PGPOOL_ADMIN_PASSWORD: ${HF_PGPOOL_PASSWORD}
168-
PGPOOL_POSTGRES_CUSTOM_USERS: ${HF_POSTGRESQL_USERNAME}
169-
PGPOOL_POSTGRES_CUSTOM_PASSWORDS: ${HF_POSTGRESQL_PASSWORD}
170-
PGPOOL_ENABLE_LOAD_BALANCING: "no"
171-
PGPOOL_AUTO_FAILBACK: "yes"
172-
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"
173-
networks:
174-
default:
175-
176-
configs:
177-
pgpool.conf:
178-
name: pgpool_conf-${pgpool_conf_DIGEST:?err}
179-
file: ./config/custom_pgpool.conf
180-
labels:
181-
name: hapi-fhir
182-
pgpool_node_id0.conf:
183-
name: pgpool_node_id0-${pgpool_node_id0_DIGEST:?err}
184-
file: ./config/pgpool_node_id0
185-
labels:
186-
name: hapi-fhir
187-
pgpool_node_id1.conf:
188-
name: pgpool_node_id1-${pgpool_node_id1_DIGEST:?err}
189-
file: ./config/pgpool_node_id1
190-
labels:
191-
name: hapi-fhir
192-
pgpool_node_id2.conf:
193-
name: pgpool_node_id2-${pgpool_node_id2_DIGEST:?err}
194-
file: ./config/pgpool_node_id2
195-
labels:
196-
name: hapi-fhir
197-
19884
volumes:
19985
hapi-postgres-2-data:
20086
hapi-postgres-3-data:

fhir-datastore-hapi-fhir/docker-compose-postgres.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ services:
1414
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
1515
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
1616
POSTGRESQL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
17+
REPMGR_FAILOVER: ${HF_POSTGRES_FAILOVER}
18+
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${HF_POSTGRES_DEGRADED_MONITORING_TIMEOUT}
1719
volumes:
1820
- "hapi-postgres-1-data:/bitnami/postgresql"
21+
configs:
22+
- target: /bitnami/postgresql/conf/conf.d/custom_postgresql.conf
23+
source: postgresql.conf
1924
deploy:
2025
replicas: 1
2126
resources:
@@ -33,6 +38,13 @@ services:
3338
volumes:
3439
hapi-postgres-1-data:
3540

41+
configs:
42+
postgresql.conf:
43+
name: postgresql_conf-${postgresql_conf_DIGEST:?err}
44+
file: ./config/custom_postgresql.conf
45+
labels:
46+
name: hapi-fhir
47+
3648
networks:
3749
default:
3850
hapi-fhir-postgres:

fhir-datastore-hapi-fhir/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.9'
22

33
services:
44
hapi-fhir:
5-
image: jembi/hapi:v6.0.1-wget
5+
image: jembi/hapi:${HF_IMAGE_TAG}
66
networks:
77
mpi:
88
public:
@@ -13,7 +13,7 @@ services:
1313
- spring.datasource.password=${HF_POSTGRESQL_PASSWORD}
1414
- spring.datasource.driverClassName=org.postgresql.Driver
1515
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
16-
- spring.datasource.hikari.maximumPoolSize=250
16+
- spring.datasource.hikari.maximumPoolSize=${HF_MAX_POOL_SIZE}
1717
- spring.datasource.hikari.minimumIdle=20
1818
- spring.datasource.hikari.connectionTimeout=60000
1919
- spring.datasource.hikari.idleTimeout=600000
@@ -36,8 +36,8 @@ services:
3636
healthcheck:
3737
test: /bin/wget --no-verbose --tries=1 --spider http://localhost:8080/fhir/Organization?identifier=urn:healthcheck
3838
interval: 30s
39-
timeout: 30s
40-
retries: 2
39+
timeout: 5s
40+
retries: 5
4141
start_period: 2m
4242

4343
networks:

fhir-datastore-hapi-fhir/package-metadata.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"HF_PGPOOL_MEMORY_LIMIT": "500M",
3333
"HF_PGPOOL_CPU_RESERVE": "0.05",
3434
"HF_PGPOOL_MEMORY_RESERVE": "50M",
35-
"HF_JAVA_OPTS": "-Xmx2g"
35+
"HF_JAVA_OPTS": "-Xmx2g",
36+
"HF_IMAGE_TAG": "v6.0.1-wget",
37+
"HF_MAX_POOL_SIZE": "80",
38+
"HF_PGPOOL_ENABLED": "true",
39+
"HF_POSTGRES_FAILOVER": "automatic",
40+
"HF_POSTGRES_DEGRADED_MONITORING_TIMEOUT": "5"
3641
}
3742
}

0 commit comments

Comments
 (0)