Gateway HUB - How to recreate Postgress database in one of the nodes
The steps to follow in order to restore data on the faulty node Copied
-
Stop the Hub on all nodes:
- If systemd is managing the Hub:
sudo systemctl mask hub-orchestration sudo systemctl stop hub-orchestration- or run
/opt/hub/current/bin/hub.sh stopon each node
-
Ensure that the Hub is stopped on each node. First run
/opt/hub/latest/bin/hub.sh statusthen check that Postgres is effectively stopped:ps -edf|grep postgres: -
On one healthy node, make a tarball of
/opt/hub/postgresand a tarball of/opt/hub/pgwaland copy across to node -
On the faulty node, rename /opt/hub/postgres to
/opt/hub/postgres.<timestamp>and/opt/hub/pgwalto/opt/hub/pgwal.<timestamp>. -
On the faulty node, unzip the tarballs copied from healthy node so that you end up with
/opt/hub/postgresand/opt/hub/pgwal -
On the faulty node, start Postgres manually by running
/opt/hub/latest/services/postgres-timescale-12.6-1.7.4/start.shand wait until you see the following in the logs:LOG: database system is ready to accept connections LOG: TimescaleDB background worker launcher connected to shared catalogs -
On the faulty node, stop Postgres using a Ctrl-C
-
Restart the Hub normally using
hubctlor systemd.