Configure External Database to Connect OpenG2P Environment
PreviousAccess a Database from Outside the ClusterNextConfigure IPSec VPN Gateway to Connect to External Systems using Strongswan
Last updated
vim /etc/postgresql/14/main/postgresql.conf
listen_addresses = '*'
max_connections = 500
wal_level = logicalvim /etc/postgresql/14/main/pg_hba.confsudo systemctl restart postgresqlss -nlt | grep 5432psql -U postgres -h localhostCREATE ROLE socialregistryuser WITH LOGIN NOSUPERUSER CREATEDB CREATEROLE INHERIT REPLICATION CONNECTION LIMIT -1 PASSWORD '<**provide password**>';
CREATE DATABASE socialregistrydb WITH OWNER = socialregistryuser TEMPLATE = template0 ENCODING = 'UTF8' TABLESPACE = pg_default CONNECTION LIMIT = -1;
CREATE ROLE odkuser WITH LOGIN NOSUPERUSER CREATEDB CREATEROLE INHERIT REPLICATION CONNECTION LIMIT -1 PASSWORD '<**provide password**>';
CREATE DATABASE odkdb WITH OWNER = odkuser TEMPLATE = template0 ENCODING = 'UTF8' TABLESPACE = pg_default CONNECTION LIMIT = -1;psql -U socialregistryuser -h localhost -d socialregistrydb
psql -U odkuser -h localhost -d odkdb#Make the default postgresql enabled equals to false.
postgresql:
auth:
database: socialregistrydb/pbmsdb
username: socialregistryuser/pbmsuser
enabled: false
#Add the below parameters in the last section of default postgresql.
externalDatabase:
create: false
database: socialregistrydb/pbmsdb
host: <IP address of External DB>
password: <password for DB>
port: 5432
user: socialregistryuser/pbmsuserodk-central:
backend:
envVars:
DB_HOST: <IP address of External DB>
DB_NAME: odkdb
DB_USER: odkuser
envVarsFrom:
DB_PASSWORD: <password for ODK DB>
postgresql:
enabled: falseenvVars:
DB_NAME: socialregistrydb/pbmsdb
DB_HOSTNAME: `<IP address of External DB>`
DB_USER: socialregistryuser/pbmsuser
envVarsFrom:
DB_PASS: `<password for SR DB>`