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.
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.
In order to avoid network latency issues when reading and writing artifacts data, it is highly recommended to create the database on the same machine on which Artifactory will be running or on a fast SAN disk. |
[root@pond artifactory]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.0.45 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database artifactory character set utf8; Query OK, 1 row affected (0.00 sec) mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on artifactory.* TO 'artifactory_user'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit |
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):
# The MySQL server [mysqld] . . # This will be the maximum size of the binary artifacts (e.g. jars) the server can handle max_allowed_packet=128M . . |
$ARTIFACTORY_HOME/etc/artifactory.system.properties:
artifactory.jcr.configPath=repo/mysql |
$ARTIFACTORY_HOME/etc.$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.).FileSystem). Minimal load and no connection pooling.DataStore). Heavily loaded and uses connection pooling.PersistenceManager).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.The above process refers to a clean installation of Artifactory. If, by mistake, you started up Artifactory using the built-in database, Artifactory will "stick" to that database. You'd have to move away the |