Artifactory 3.4
Skip to end of metadata
Go to start of metadata
Table of Contents

Overview

By using MySQL you can benefit from features in the MySQL infrastructure such as backup, restore and high availability.

For Artifactory to run with MySQL you must create a dedicated MySQL database instance and then configure Artifactory to use it as described in the following sections.

Before You Continue

Before proceeding with the steps below, please make sure you have read and followed the steps described in Changing the Default Storage.

Page Contents


Creating the Artifactory MySQL Database

Supported MySQL Versions

Artifactory supports MySQL v5.5 and above with InnoDB engine which is the default provided.

Artifactory provides a script that will execute the SQL commands you need to create your MySQL database.

The script can be found in $ARTIFACTORY_HOME/misc/mysql/createdb.sql and is displayed below.

You should review the script and modify it as needed to correspond to your specific environment.

createdb.sql Script

Artifactory privileges

We recommend providing Artifactory with full privileges on the database

Selecting a Case-sensitive Collation

While MySQL Database Server is not case-sensitive by default, it is important to select a case-sensitive collation because Artifactory is case-sensitive. 

For example, in the createdb.sql script above COLLATE is set to "utf8_bin".

 


Increasing MySQL Default Packet Size

Since some data files (builds, configurations etc.) are stored in MySQL, it is extremely important to increase the maximum allowed packet size used by MySQL to avoid errors related to large packets.  

(Please refer to MySQL documentation:  Packet Too Large).

It is recommended to change this in the /etc/my.cnf file as follows:

Modifying /etc/my.cnf

/etc/my.cnf Absolute Path

If /etc/my.cnf does not already exist it should be created under the absolute path and not under $ARTIFACTORY_HOME

Restart required

After modifying the maximum allowed packed size you need to restart MySQL

 


Tuning MySQL for Artifactory

When using Artifactory with MySQL it is recommended to use the InnoDB engine with the following tuning parameters configured in the /etc/my.cnf file:

Tuning Parameters for MySQL

Restart required

After tuning, you need to restart MySQL


Configuring Artifactory to use MySQL

  1. Copy $ARTIFACTORY_HOME/misc/db/mysql.properties to $ARTIFACTORY_HOME/etc/storage.properties
    (If you do not have this file you can take it from the standalone zip distribution or directly from the JFrog domain). For a full explanation on the contents of this file please refer to The Bundled Storage Configurations.


  2. Adjust the connection definitions in the $ARTIFACTORY_HOME/etc/storage.properties file to match the attributes of the Artifactory database you created.
    You must configure the database URL and username/password to use. The schema and tables are created first time Artifactory is run using the new database.
     
  3. Download the MySQL JDBC driver (available from the  MySQL website)  and copy the mysql-connector-java-<version>.jar file into the server's shared lib directory.
    For example $TOMCAT_HOME/lib when installed as a service or $ARTIFACTORY_HOME/tomcat/lib in the standalone version.
     
  4. Start Artifactory.

 

Storing BLOBs inside MySQL

The suggested (and recommended) configuration stores all artifact information in MySQL while the artifact binary data is stored on the file system (under $ARTIFACTORY_HOME/data/filestore).
While it is not recommended, it is possible to store BLOBs inside MySQL provided that the typical BLOB size is relatively small. Storing large BLOBs in MySQL can cause memory issuesbecause MySQL buffers BLOBs rather than streaming them (please refer to MySQL Bug #15089) and may result in OutOfMemory errors with large binaries depending on your JVM heap size.

To store BLOBs in MySQL, in the storage.propreties file set binary.provider.type=fullDb and change max_allowed_packet to be higher than the maximum artifact size you intend to store in Artifactory.

 

 

 

 

 

  • No labels