Artifactory supports MariaDB v10.2.9 and above.
Artifactory supports the MariaDB Java Connector versions 2.1.2 and above.
Artifactory provides a script that will execute the SQL commands you need to create your MariaDB database.
The script can be found in
$ARTIFACTORY_HOME/misc/db/createdb/createdb_mariadb.sql and is displayed below.
You should review the script and modify it as needed to correspond to your specific environment.
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL on artdb.* TO 'artifactory'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
Once you have verified that the script is correct, you need to run it to create the database and proceed with configuring the database.
If you are running MariaDB database on a Docker container please use the following:
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL on artdb.* TO 'artifactory'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
While MariaDB 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
We recommend providing Artifactory with full privileges on the database.
(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.
$ARTIFACTORY_HOME/etc/db.propertiesfile to match the attributes of the Artifactory database you created.
Download the MariaDB JDBC driver (available from the ) and copy the
mariadb-java-client-<version>.jar file into the server's shared lib directory.
$TOMCAT_HOME/lib when installed as a service or
$ARTIFACTORY_HOME/tomcat/lib in the standalone version.
Make sure your driver has the same permissions as the rest of the files in the shared lib directory.
The suggested (and recommended) configuration stores all artifact information in MariaDB while the artifact binary data is stored on the file system (under
To store BLOBs in MariaDB, you will need to configure the Filestore with the Full-DB Binary Provider and change
The MariaDB Connector/J does not support the special . JDBC Connection Pools perform regular validity checks on connections in the pool, which use an SQL validation query.
Since some data files (builds, configurations etc.) are stored in MariaDB, it is extremely important to increase the maximum allowed packet size used by MariaDB to avoid errors related to large packets.
To learn more, please refer to in the MariaDB.
We recommend changing this parameter in the
/etc/my.cnf file as follows:
# The MariaDB server [MariaDBd] . # The maximum size of the binary payload the server can handle max_allowed_packet=8M .
After modifying the maximum allowed packed size you need to restart MariaDB.
You can also change the
Note, however, that upon a restart, the value of the
When using Artifactory with MariaDB it is recommended to use the InnoDB engine with the following tuning parameters configured in the
# The MariaDB server [mysqld] . # By default innodb engine use one file for all databases and tables. We recommend changing this to one file per table. # NOTE: This will take effect only if Artifactory tables are not created yet! Need to be set and MariaDB restarted before starting Artifactory for the first time. innodb_file_per_table # Theses are tuning parameters that can be set to control and increase the memory buffer sizes. innodb_buffer_pool_size=1536M tmp_table_size=512M max_heap_table_size=512M # Theses control the innodb log files size and can be changed only when MariaDB is down and MariaDB will not start if there are some innodb log files left in the datadir. # So, changing theses means removing the old innodb log files before start. innodb_log_file_size=256M innodb_log_buffer_size=4M .
Note that both the XtraDB and InnoDB engines are compatible with the various InnoDB system variables.
After tuning MariaDB to work with Artifactory, you need to restart MariaDB.
Both MySql and MariaDB servers do support the “/* ping */” query, but the MariaDB Connector/J wraps the query as if it was a standard SQL query and transforms it into a “SET STATEMENT...” query, which is illegal in terms of syntax as far as the server is concerned. For this reason, Artifactory uses a generic “SELECT 1” as a validation query for pooled connections when MariaDB is used as a database type. The MySql Connector has no such limitation, and supports the “/* ping */” query.