Overview
Artifactory can be configured to run with almost any JDBC database for its data store. The instructions below describes how to set up Artifactory on MySQL. By using MySQL (over the built-in Derby DB) you can leverage exiting MySQL infrastructure and use the MySQL backup, restore and high-availability features. The setup involves creating the dedicated MySQL database instance and then configuring Artifactory to use that instance.
Create the Artifactory MySQL Database
You can use the $ARTIFACTORY_HOME/misc/mysql/createdb.sql SQL script to execute the SQL commands below to create a database. Please review and edit this script before executing it, according to your environment.
Increasing the MySQL Default Packet Size
Since binaries files are stored in MySQL, it is extremely important to increase the default packet size used by MySQL when serving binaries (see: max_allowed_packet increase, for reference).
We recommend changing this in the /etc/my.cnf file (create this file if it does not already exist):
- Add (or uncomment) the following line in
$ARTIFACTORY_HOME/etc/artifactory.system.properties:
Note: this path is relative to $ARTIFACTORY_HOME/etc.
- Adjust the connection definitions in the file
$ARTIFACTORY_HOME/etc/repo/mysql/repo.xml to match the attributes of the Artifactory database you created (if you don't have this file you can grab it from the standalone zip distribution or directly from here.).
Jackrabbit uses 3 separate connection configurations for each of the following:
- The basic JCR repository metadata (configured under
FileSystem). Minimal load and no connection pooling.
- The JCR datastore for all the binaries (configured under
DataStore). Heavily loaded and uses connection pooling.
- The JCR workspace (signle in our case) metadata (configured under
PersistenceManager).
For each one of these tags you need to configure which database parameters and username/password to use. The schema and tables will be created on first run of Artifactory against the database.
- Download the MySQL JDBC driver and copy the
mysql-connector-java-x.x.x.jar jar file into the server's shared lib directory ($ARTIFACTORY_HOME/lib in the standalone version), or to the the WEB-INF/lib directory of an exploded artifactory.war.
- Start Artifactory.