Configuring the Artifactory with PostgreSQL HA connectivity:

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
Provided below is a generic example of setting up Artifactory with PostgreSQL HA

Prerequisites:
  1. Set-up 2 or more PostgreSQL version 13.x servers
  2. Create the Artifactory Databases on each of your PostgreSQL servers
  3. Enable PostgreSQL Connectivity from Remote Servers
After completing the prerequisite steps, proceed with editing the $JFROG_HOME/artifactory/var/etc/system.yaml file to configure the JDBC URLs as follows:
 shared:
   database:
     type: postgresql
     url: "jdbc:postgresql://<PostgreSQL(Node1)-IP>:<PORT>,<PostgreSQL(Node2)-IP>:<PORT>,<PostgreSQL(Node3)-IP>:<PORT>/artifactory?targetServerType=primary"
     driver: org.postgresql.Driver
     username: "artifactory"
     password: "password"
 metadata:
   database:
     type: postgresql
     url: "jdbc:postgresql://<PostgreSQL(Node1)-IP>:<PORT>,<PostgreSQL(Node2)-IP>:<PORT>,<PostgreSQL(Node3)-IP>:<PORT>/artifactory?target_session_attrs=read-write"
     driver: org.postgresql.Driver
     username: "artifactory"
     password: "password"
...
In case that you are using an Artifactory HA cluster, please make sure to edit the system.yaml files of all of the Artifactory nodes to reflect the changes made.