Configure Sharding for HA Cluster
For a high availability cluster, Artifactory offers templates that file supportsharding-clusterfor system, S3, and Google Storage.
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, you need to place the binarystore.xml under $JFROG_HOME/artifactory/var/etc/artifactory in the primary node and it will be synced 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 as follows:
<config version="2">
<chain template="cluster-file-system"/>
</config>What's in the template
While you don't 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>Details about the cache-fs provider can be found in the Cached Filesystem Binary Provider section.
Details about the sharding-cluster can be found in the Sharding-Cluster Binary Provider section.
Details about the state-aware sub-provider can be found in the State-Aware Binary Provider section.
Cluster-File-System Example
The following example shows a file system cluster binary configuration with a custom file store 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 2 days ago
