Follow the steps mentioned in Install Artifactory Single Node with Docker Compose to install Artifactory on the first node of your HA cluster, but do not start the Artifactory service yet.
Important
When transitioning from a single-node installation of Artifactory to a high-availability (HA) setup. If the single-node instance is already running, stop it immediately. As, this step is crucial to avoid conflicts during the HA configuration process.
Configure the database and node configuration details in
system.yaml
file under$JFROG_HOME/artifactory/var/etc/system.yaml
. For more information, see Artifactory Product Configuration.Note
We recommend using the PostgreSQL database. For more information, see PostgreSQL installation.
In the node section, ensure that you have set
haEnabled
value astrue.
For example,
shared: node: haEnabled: true taskAffinity: any
Note
If you want to avoid using
config.sh
to install Artifactory HA, you can copytemplates/docker-compose.yaml
from the Docker Compose archive to each of the nodes and update.env
file accordingly to your setup.Depending on your choices, a selected
docker-compose.yaml
will be available in the extracted folder. However, there are a few docker-compose templates in the directory templates. You can choose any template and copy it to the extracted folder asdocker-compose.yaml
.Configure the filestore in
$JFROG_HOME/artifactory/var/etc/artifactory/binarystore.xml
with the following entry:<config version="2"> <chain template="cluster-file-system"/> </config>
If the directory and file does not exist, you can create them yourself.
Start the node.
docker-compose -p rt-postgres -f docker-compose-postgres.yaml up -d docker-compose -p rt up -d docker-compose -p rt ps docker-compose -p rt down
Follow Steps 1 through 3 again to install each additional node in the HA cluster.
Note
For Artifactory, it is recommended to have three or more nodes in an HA setup.
All nodes must have the same database configuration and filestore configuration.
Copy the
master.key
from the first node to the following location$JFROG_HOME/artifactory/var/etc/security/master.key
in the additional nodes.For a node to join a cluster, the node must have the same database configuration and the master key.
Start the additional nodes.
Check the Artifactory log.
Configure log rotation of the console log
The
console.log
file can grow quickly since all services write to it. For more information, see configure the log rotation.Configuring Log Rotation for Tomcat
Node ID and IP
For Docker installations, verify that the host's IDshared.node.id
and IPshared.node.ip
are added to thesystem.yaml
.
If these are not manually added, they are automatically resolved as the container's hostname and IP, meaning other nodes and services will not be able to reach this instance.
Install a non-management node
By default, all Artifactory nodes in a cluster are installed as equal nodes, meaning they can be be used to manage the cluster. You also have the option of installing a node that does not have management capabilities.
Set the system.yaml
parameter taskaffinity
to none for a non-management node.
Add licenses according to your license type.
License Key
Option 1: Copy the
artifactory.cluster.license
file to the first node's configuration directory.cp artifactory.cluster.license $JFROG_HOME/artifactory/var/etc/artifactory/
This can also be done once you start Artifactory using:
Option 2: License Management in the UIManage Licenses
Option 3: Install License REST APIInstall License
Specifying multiple licenses
Whether in the Artifactory UI, using the REST API or in the artifactory.cluster.license
file, make sure that the licenses are separated by two newlines.
License Bucket
Applying a license bucket requires JFrog Mission Control.
Complete configuring and starting the first node.
Enable Mission Control microservice in Artifactory.
Apply your license Bucket Management in the UIManage Licenses
After installing and before running Artifactory, you may set the following configurations:
System YAML Configuration File
Where to find system.yaml?
You can configure all your system settings using the
system.yaml
file located in the$JFROG_HOME
/artifactory/var/etc
folder. For more information, see System YAML configuration.If you don't have a System YAML file in your folder, copy the template available in the folder and name it
system.yaml
.For the Helm charts, the
system.yaml
file is managed in the chart’svalues.yaml
file.Configuring Database
If you're planning to use it in production, it is highly recommended to first Configure the Database, and then start Artifactory.
Customize Java Opts (optional)
Remember to modify your JVM Parameters as needed by setting
JAVA_OPTIONS
in Shared Configurations. The property to pass extra Java opts isartifactory.extraJavaOpts
. It is highly recommended to set your Java memory parameters as follows:Tip
The larger your repository or number of concurrent users, the larger you need to make the -Xms and -Xmx values accordingly. If you can reserve at least 512MB for Artifactory, the recommended minimal values are:
-server -Xms512m -Xmx2g -Xss256k -XX:+UseG1GC
For more recommendations about your hardware configuration (especially the -Xmx parameter), see System Requirements
Additional Settings
The additional settings are about customizing ports, joinKey (join.key) and masterKey (master.key).
Configuring the Filestore
By default, Artifactory is configured to use the local file system as its filestore. Artifactory supports a variety of additional filestore configurations to meet a variety of needs for binary storage providers, storage size, and redundancy.
Enable TLS 1.0 and 1.1 for Connectivity with Older Databases
Artifactory version 7.25.2 onwards includes OpenJDK version 11.0.11 and later. TLS 1.0 and TLS 1.1 are disabled by default from OpenJDK 11.0.11 onwards. If your database version does not support TLS 1.2, the Artifactory startup fails.
If you are unable to upgrade your database to a version that supports TLS 1.2 or later, perform the following steps to run Artifactory.
Download the java.security file that has TLS 1.0 and 1.1 enabled.
Create the directory,
${JFROG_HOME}/artifactory/var/bootstrap/artifactory/java
.Copy the java.security file into
${JFROG_HOME}/artifactory/var/bootstrap/artifactory/java.
Provide the appropriate permissions to the directory.
Note
Artifactory startup takes a backup of the existing java.security file and bootstraps custom java.security into the
${JFROG_HOME}/artifactory/app/third-party/java/conf/security
folder.