To set this up quickly and efficiently, we recommend using the built-in Virtual Machine Failover feature offered by virtualization software providers as follows:
Create a VM image that runs the Artifactory startup script and mounts the auxiliary storage.
The storage should contain the full Artifactory installation along with the data in a location defined as $ARTIFACTORY_HOME.
Use the VM image on two Virtual Machines and have Artifactory running on one machine while the other machine is readily available as a failover target by the virtualization monitor.
If deployment on fault-tolerant storage, as described in the previous section, is not possible (or if redundancy is required), fault-tolerance can be achieved by correctly replicating the data folder to a warm standby server.
The setup of an up-to-date passive replication server for the active Artifactory server requires database replication and synchronization of file system directories.
To synchronize the data and configuration directories you need to run
This can be done by running the
rsync command on
$ARTIFACTORY_HOME while excluding the directories that are not required as follows:
rsync -vvah --del --progress --log-file=/home/replication/replication.log --exclude-from=rsync-excludes.txt \ artifactory@active-artifactory-host:$ARTIFACTORY_HOME/ $ARTIFACTORY_HOME/
For the above example the
rsync-excludes.txt file appears as follows:
/work/ /data/tmp*/ /data/cache/ /logs/
Database replication must run before executing
The procedure to synchronize a database varies between the different database vendors. Please refer to the relevant documentation for your specific database.
For example, instructions on how to synchronize with MySQL can be found in the MySQL documentation for .
It is also possible to use a full dump/restore procedure on the database to synchronize the database and filestore state. In this case, we recommend that you perform the dump in a single routine along with
rsync (in case of File System Storage Types).
It is very important that the metadata stored in the database and the data stored on the file system are synchronized on the standby server.
A straightforward way to achieve this, is to make sure that the database synchronized is in a state that is prior to the file system (data/filestore) state.
This allows you to:
Since the sync operations are not atomic, there may be a gap between the data from
rsync and data from database replication.