org.postgresql.util.PSQLException: Connection to xx.xxx.x.xx:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
"FATAL: could not load pg_hba.conf
LOG: database system is shut down
VMware Cloud Director
The issue because IP addresses added in the "IPv4 local connections" section in the pg_hba.conf
file do not have a valid subnet and causing postgres to shutdown and going in failed status.
To help solving the issue, you will need to make sure that the ip addresses placed in he pg_hba.conf
file contain an IP address with a valid subnet.
For example, checking the file /var/vmware/vpostgres/current/pgdata/pg_hba.conf
you will see entries where the /32 subnet is missing:# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all <IP_ADDRESS_1>/32 md5
host all all <IP_ADDRESS_2> md5 < missing subnet
host all all <IP_ADDRESS_3> md5 < missing subnet
edit the pg_hba.conf
file and add the /32 subnet:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all <IP_ADDRESS_1>/32 md5
host all all <IP_ADDRESS_2>/32 md5
host all all <IP_ADDRESS_3>/32 md5
You will then need to create a text file placed in the folder /opt/vmware/appliance/etc/pg_hba.d/
and containing the correct IPv4 local connection.
After that reboot the cell to apply the changes.
To refer to the document which explain that you can add External IP addresses: Configure External Access to the VMware Cloud Director Database