We have a test environment with a blown up Postgres install. Following the below steps yields a "Cannot Init DB" during the install when using the /opt/apigee4/share/installer/apigee-postgres-install.sh during Step 3 and never reinstalls the postgresql process. Postgres-Server seems to install but obviously won't start right.
Install is a 3 node system with QPID/Postgres residing on the same server.
Postgres DB
1) Stop postgresql on all master and standby nodes
2) Remove old postgresql
[node]# SERVICE=pgsql
[node]# rm -fr $INST_DIR/share/${SERVICE}*
[node]# SERVICE=postgresql
[node]# rm -fr $INST_DIR/conf/${SERVICE}
[node]# rm -fr $INST_DIR/data/${SERVICE}
[node]# rm -fr $INST_DIR/var/log/${SERVICE}
3) Re-install postgresql.
Note that the script takes configuration from $INST_DIR/bin/apigee-env.sh.
[node]# $INST_DIR/share/installer/apigee-postgres-setup.sh
4) Restore postgresql
[node]# $INST_DIR/bin/restore-postgres.sh -b $BACKUP_PATH -d $BACKUP_DATE
5) Restart all Postgres Servers.
Note that the restored node will be the master. You can change other Postgres Server to standby, if necessary.
Below is the output from Step 3:
[node]#:~> /opt/apigee4/share/installer/apigee-postgres-setup.sh
Checking prerequisites
Checking if following packages are installed:
kernel.sem: OK
kernel.shmmax: OK
kernel.shmall: OK
Installing postgres
Finished installing postgres
Starting Postgres Setup
Cannot init DB
[node]#:~>