Troubleshooting PostgreSQL HA setup using the Bitnami PostgreSQL HA image:

ARTIFACTORY: How to configure an HA PostgreSQL Database with Artifactory?

AuthorFullName__c
Nir Shervi
articleNumber
000005620
ft:sourceType
Salesforce
FirstPublishedDate
2023-03-15T16:55:43Z
lastModifiedDate
2023-03-19T12:45:10Z
VersionNumber
2
PostgreSQL HA requires some additional configuration compared to the PostgreSQL stand-alone instance, hence, it is more prone to configuration missteps.

When troubleshooting the PostgreSQL HA setup, the first thing to consider is whether the issue is with the Artifactory configuration or the PostgreSQL HA configuration, you may install the following PostgreSQL HA packaged by Bitnami pack and configure it to the Artifactory HA cluster (since it is verified to properly function with Artifactory).

After installing the above package, exec into the container and perform the following instructions (the below steps are for docker-compose):
1. Execute the following command in order to access the container:
docker-compose exec pg-0 bash
2. Inside the container, run the following (password: “adminpassword”):
psql -U postgres
3. Run the following queries on the PostgreSQL HA primary node (the first database in the URL chain)
CREATE USER artifactory WITH PASSWORD 'password';
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;
4. Execute the below command to retrieve the locally mapped ports (as seen in the picture below):
docker-compose ps
User-added image

5. Create (or modify) PostgreSQL HA URL in the system.yaml file, using the ports retrieved in section (4), as shown below:

User-added image

After executing the above instructions, you may start the Artifactory service.

To verify the functionality of the PostgreSQL HA setup, please execute the steps that are specified in the “Verification” section of this knowledge base article.