Sharding Configuration for HA Cluster
Use cluster-file-system, cluster-s3, or cluster-google-storage templates with sharding-cluster provider for Artifactory HA.
For a high availability cluster, Artifactory offers templates that supportsharding-clusterfor file system, S3, and Google Storage.
When configuring your filestore on an HA cluster, place the binarystore.xml under $JFROG_HOME/artifactory/var/etc/artifactory on the primary node; it syncs automatically to the other members in the cluster.
Cluster-File-System Binary Provider
When using the cluster-file-system template, each node has its own local filestore (just like in the file-system binary provider) and is connected to all other cluster nodes via dynamically allocated Remote Binary Providers using the Sharding-Cluster Binary Provider.
Cluster-File-System Template Configuration
If you choose to use the cluster-file-system template, your binarystore.xml configuration file should look like this:
<config version="2">
<chain template="cluster-file-system"/>
</config>What's in the template
While you do not need to configure anything else in your binarystore.xml, this is what the cluster-file-system template looks like under the hood:
<config version="2">
<chain> <!-- template="cluster-file-system" -->
<provider id="cache-fs" type="cache-fs">
<provider id="sharding-cluster" type="sharding-cluster">
<sub-provider id="state-aware" type="state-aware"/>
<dynamic-provider id="remote-fs" type="remote"/>
</provider>
</provider>
</chain>
<provider id="state-aware" type="state-aware">
<zone>local</zone>
</provider>
<!-- Shard dynamic remote provider configuration -->
<provider id="remote-fs" type="remote">
<zone>remote</zone>
</provider>
<provider id="sharding-cluster" type="sharding-cluster">
<readBehavior>crossNetworkStrategy</readBehavior>
<writeBehavior>crossNetworkStrategy</writeBehavior>
<redundancy>2</redundancy>
<property name="zones" value="local,remote"/>
</provider>
</config>For details about the cache-fs provider, see Cached Filesystem Binary Provider.
For details about the sharding-cluster, see Sharding-Cluster Binary Provider.
For details about the state-aware sub-provider, see State-Aware Binary Provider.
Cluster-File-System Example
The following example shows a file system cluster binary configuration with a custom filestore directory.
<config version="2">
<chain> <!-- template="cluster-file-system" -->
<provider id="cache-fs" type="cache-fs">
<provider id="sharding-cluster" type="sharding-cluster">
<sub-provider id="state-aware" type="state-aware"/>
<dynamic-provider id="remote-fs" type="remote"/>
</provider>
</provider>
</chain>
<provider id="cache-fs" type="cache-fs">
<cacheProviderDir>/opt/jfrog/artifactory/var/data/artifactory/cache</cacheProviderDir>
<maxCacheSize>500000000</maxCacheSize>
</provider>
<provider id="state-aware" type="state-aware">
<zone>local</zone>
<fileStoreDir>/opt/jfrog/artifactory/var/data/artifactory/filestore</fileStoreDir>
</provider>
<!-- Shard dynamic remote provider configuration -->
<provider id="remote-fs" type="remote">
<zone>remote</zone>
</provider>
<provider id="sharding-cluster" type="sharding-cluster">
<readBehavior>crossNetworkStrategy</readBehavior>
<writeBehavior>crossNetworkStrategy</writeBehavior>
<redundancy>2</redundancy>
<lenientLimit>1</lenientLimit>
<property name="zones" value="local,remote"/>
</provider>
</config>Updated 3 days ago
