ARTIFACTORY: Migrating the File-system to Sharding to the existing binaystore.xml and adding additional mount without losing the data

ARTIFACTORY: Migrating the File-system to Sharding to the existing binaystore.xml and adding additional mount without losing the data

AuthorFullName__c
Muniraju M K
articleNumber
000006216
ft:sourceType
Salesforce
FirstPublishedDate
2024-10-27T11:16:29Z
lastModifiedDate
2024-10-27
VersionNumber
3
Use case 

The current binarystore.xml configuration uses the file-system chain template.
I want to migrate from the file-system template to the sharding template in the existing binarystore.xml file by adding additional storage mounts.
config version="1">
   <chain template="file-system"/>
</config>

 

 

Solution

We can transition to the sharding configuration by replacing the default binarystore.xml file and adding an additional NFS mount, all without data loss. Use the following binarystore.xml for this migration:
config version="4">
   <chain>
       <provider id="cache-fs" type="cache-fs">                   <!-- This is a cached filestore -->
           <provider id="sharding" type="sharding">                   <!-- This is a sharding provider -->
               <sub-provider id="mount1" type="state-aware"/>     <!-- There are three mounts -->
               <sub-provider id="mount2" type="state-aware"/>
           </provider>
       </provider>
   </chain>
 
// Specify the read and write strategy and redundancy for the sharding binary provider

  <provider id="sharding" type="sharding">
       <readBehavior>roundRobin</readBehavior>                     
       <writeBehavior>percentageFreeSpace</writeBehavior>
       <redundancy>1</redundancy>
 </provider>
 
 
//For each sub-provider (mount), specify the filestore location
   <provider id="mount1" type="state-aware">
       <fileStoreDir>/test-mount1/jfrog/artifactory/var/data/artifactory/filestore</fileStoreDir>
   </provider>

// For new mount 2
 
   <provider id="mount2" type="state-aware">
       <fileStoreDir>/test-mount2/jfrog/artifactory/var/data/artifactory/filestore</fileStoreDir>
   </provider>
 
</config>

In the above binarystore.xml file, test-mount2 is an additional mount added to the file.

The path of the filestore on test-mount2 can be specified by providing an absolute path in <fileStoreDir>. For eg, /test-mount2/jfrog/artifactory/var/data/artifactory/filestore. 


Restart the Artifactory to take changes into effect. 

Once the Artifactory is initialised, you would able to see the “_pre” directory created under the path /test-mount2/jfrog/artifactory/var/data/artifactory/filestore. 

User-added image