Oak TarMK Compaction

 

If we are using Tar files as the storage, it tends to grow in size and starts claiming disk space every time when data is created or updated as data in tar files are never overwritten rather it keeps adding new versions. To mitigate the same, AEM has garbage collection mechanism which is known as ‘Tar Compaction’ to remove the unused data and reclaim the disk space.

We can be triggered from ‘Revision https://www.acheterviagrafr24.com/viagra-pharmacie/ Clean Up’ in the Operations Dashboard (http://<host>:<port>/libs/granite/operations/content/maintenance.html). However, it can done faster via offline compaction. Follow the below steps to do the same

Step1: Download the ‘Oak-run’, Tar Compaction Tool – http://mvnrepository.com/artifact/org.apache.jackrabbit/oak-run/

Make sure you download the right version of the tool based on your oak repository version. Latest version of oak with AEM 6.1 and SP1 is 1.2.11

Step2: Shutdown the AEM instance. Take the backup

 

Note:

<aem-folder> – is the path where the aem jar file resides

<backup> – is the path where the backup has to be stored

Step3: Find all the checkpoints using the oak-run tool with the below command. This finds all the unreferenced points

checkpoints
checkpoints

Step4: Remove all the unreferenced checkpoints

You will see how many checkpoints get removed, if you had any!

Step4: Now, run the compaction of the tar files

Step5: Check your repository file size. It would have reduced drastically!

compact completion
compact completion

We can also create a script combining all the above steps to automate the same

 

8 thoughts on “Oak TarMK Compaction

  1. HI,

    Gives this error when I tried to run.
    C:\AEM\For_Offline_Tar_Compaction_6.1_SP1>java -jar oak-run-1.2.11.jar backup C:
    /AEM/6.1/author/crx-quickstart/repository/segmentstore C:/AEM/6.1/backup_author
    Error: Could not find or load main class ?jar

    Please help.

     
  2. “Make sure you download the right version of the tool based on your oak repository version. Latest version of oak with AEM 6.1 and SP1 is 1.2.11”

    I am not running AEM 6.1. Is there any way to determine which version of oak I am running?

    Thanks in advance.

     
  3. Guys,

    I am trying to use above automation code to run tar compaction offline and troubling with one silly issue. My AEM folder contains space and I could not rename it, can anyone tell me how to specify the path with space in name ?

    Thanks in advance !!

     

Leave a Reply

Your email address will not be published. Required fields are marked *