Artifactory Clustering

Deploy Active/Active cluster for full HA or Active/Passive for fast disaster recovery on fault-tolerant shared storage.

Active/Active Architecture

Artifactory's clustered Active/Active architecture provides a full set of true high availability features and is supported with an Artifactory Enterprise License. For more information, see Artifactory High Availability.

Active/Passive Architecture

Artifactory's clustered Active/Passive architecture provides fast disaster recovery and can be implemented in the following methods:

  • Deployment on fault-tolerant storage (recommended)
  • Periodic cross-server data sync

Deployment on Fault-tolerant Storage

If the active server goes down, a fault-tolerant disk mounted on another machine allows for a very short MTR (Mean Time to Recovery). If Artifactory is deployed on a NAS or SAN, the passive machine can immediately mount the storage, bootstrap Artifactory from it, and start accepting requests in place of the originally active machine.

Follow these steps to set this up. We recommend using the built-in Virtual Machine Failover feature offered by virtualization software providers.

  1. Create a VM image that runs the Artifactory startup script and mounts the auxiliary storage.
  2. The storage should contain the full Artifactory installation along with the data in a location defined as $JFROG_HOME/artifactory.
  3. 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.

Cross-server Data Synchronization

If deployment on fault-tolerant storage is not possible, or if redundancy is required, achieve fault-tolerance by 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.

Synchronizing the Data and Configuration Directories

To synchronize the data and configuration directories, run rsync on $JFROG_HOME/artifactory/var/data and $JFROG_HOME/artifactory/var/etc.

Run the rsync command on $JFROG_HOME/artifactory while excluding the directories that are not required:

rsync -vvah --del --progress --log-file=/home/replication/replication.log --exclude-from=rsync-excludes.txt \ 
artifactory@active-artifactory-host:$JFROG_HOME/artifactory $JFROG_HOME/artifactory

For the example above, the rsync-excludes.txt file contains:

/work/
/data/tmp*/
/data/cache/
/logs/
📘

rsync

The rsync should be executed from the passive stand-by server.

Synchronizing the Database

📘

Database Replication

Database replication must run before executing rsync.

The procedure to synchronize a database varies by database vendor. Refer to the documentation for your specific database.

For example, instructions on how to synchronize with MySQL are in the MySQL documentation.

You can also use a full dump/restore procedure to synchronize the database and filestore state. In this case, we recommend performing the dump in a single routine along with rsync (for File System Storage Types).

Time Synchronization on the Standby Server

The metadata in the database and the data on the file system must be synchronized on the standby server.

To achieve this, keep the database in a state that precedes the file system (data/filestore) state.

This allows you to:

  • Make a database dump before executing the file system sync.
  • Activate database replication on demand just before executing rsync.

Since the sync operations are not atomic, there may be a gap between the data from rsync and data from database replication.

📘

Note

  1. The snapshot time that Artifactory is set to is the database replication time.
  2. Items synced to the file system which have no representation in the database can be purged by clicking on Prune Unreferenced Data in the Administration module, and then Advanced | Maintenance in the Artifactory configuration.