Configure Artifactory HA to Use PostgreSQL Database in HA in Ansible

JFrog Installation & Setup Documentation

Content Type
Installation & Setup
ft:sourceType
Paligo
  1. Stop the Artifactory service.

  2. Edit the system.yaml file to update the following values.

    Note

    Because Artifactory uses multiple drivers and you need to configure the connection strings for these separately.

    1. The url field under the shared database section in the following format.

      jdbc:postgresql://<PostgreSQL Database 1 URL>,..., <PostgreSQL Database N URL>/artifactory?targetServerType=primary
    2. The url field under the metadata database section in the following format.

      jdbc:postgresql://<PostgreSQL Database 1 URL>,..., <PostgreSQL Database N URL>/artifactory?target_session_attrs=read-write"

      The following sample shows an example system.yaml file configuration.

      systemYaml:
       shared:
         logging:
         ...
         database:
           type: postgresql
           url: "jdbc:postgresql://17.21.0.2:5432,17.21.0.3:5432/artifactory?targetServerType=primary"
           driver: org.postgresql.Driver
           username: "artifactory"
           password: "password"
       artifactory:
         Database:
       ...
       frontend:
       ...
       access:
       ...
       metadata:
         database:
           type: postgresql
           url: "jdbc:postgresql://17.21.0.2:5432,17.21.0.3:5432/artifactory?target_session_attrs=read-write"
           driver: org.postgresql.Driver
           username: "artifactory"
           password: "password"
      ...
  3. Start the Artifactory service.