MSSQL Database

ARTIFACTORY: How to configure Artifactory with an external database when using Artifactory Helm Installation

AuthorFullName__c
Bassel Mbariky
articleNumber
000005515
ft:sourceType
Salesforce
FirstPublishedDate
2022-12-21T17:22:08Z
lastModifiedDate
2023-03-09
VersionNumber
5
To use Artifactory with an MSSQL database, adding a GO connection URL is required in order to connect to the metadata service.
Note:
  1. Pre-start  command downloads the driver and places it in /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib/ so it can be used by the Artifactory.
  2. We also use extraEnvironmentVariables to override the metadata.URL in the system.yaml to connect to the database using GO because common error is when the database password inside of the Go connection string's metadata.database.url is not encrypted after startup.
The example below which can be added to the values.yaml:
 postgresql:
   enabled: false
 waitForDatabase: false
 database:
   type: mssql
   driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
   url: 'jdbc:sqlserver://<db-hostname>:1433;databaseName=artifactory;authentication=NotSpecified;encrypt=false;sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository;'
   user: 'artifactory'
   password: 'password'
 artifactory:
   extraEnvironmentVariables:
   - name: JF_METADATA_DATABASE_URL
     value: "go:sqlserver://artifactoryuser:password@IP-ADDRESS:1433/MSSQLSERVER?database=artifactory"

   preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib; cd /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib && curl -L https://github.com/microsoft/mssql-jdbc/releases/download/v11.2.0/mssql-jdbc-11.2.0.jre17.jar -o /opt/jfrog/artifactory/var/bootstrap/artifactory/tomcat/lib/mssql-jdbc-11.2.0.jre17.jar"

Applying these changes can be done by using the below helm upgrade command (depending on the helm chart you are using – artifactory, artifactory-ha or JFrog platform):

Artifactory:

helm upgrade –install artifactory jfrog/artifactory –namespace artifactory -f values.yaml

Artifactory HA:

helm upgrade –install artifactory-ha jfrog/artifactory-ha –namespace artifactory-ha -f values.yaml

Jfrog-platform:

helm upgrade --install jfrog-platform --namespace jfrog-platform jfrog/jfrog-platform -f values.yaml