Split Apache OAK stores
Overview
One of big projects drawbacks is a size of Apache OAK which is growing very fast due to big amount of assets , binary files, background processes which are care about repository data consistency, updates and so on. Of cause we can use compaction every week but there is exists another approach – split segment and blob store out of Tar files (which is an OOTB store implementation). One of the available option is to split NodeStore and BlobStore. More about BlobStore you can read here – click.
It’s time to split your Apache OAK repository stores (NodeStore and BlobStore) if:
- Apache OAK size growing unexpectedly very fast due to big amount of assets
- you decided to improve your local repository speed and decrease memory consumption
- other (if you know what you are doing)
Steps for split
As an example we will use AEM 6.1 instance which is installed on Windows folder c:\dev\aem. Lets consider steps how to split repository with separate FileDataStore as BlobStore implementation :
- Stop Adobe AEM instance.
- Create backup of OAK repository and compact it.
- Create separate folders for:
- SegmentStore – crx-quickstart\repository_new
- BlobStore (somewhere on you environment but for perfomance this storage should be fast as possible)- C:\dev\aem\blobstore
- clone repository on new location with crx2oak tool, it’s more desirable to download it directly from “Adobe repo” rather then from aem installation folder “crx-quickstart\opt\helpers\crx2oak”:
java -jar crx2oak-1.4.6-standalone.jar --copy-binaries --src-datastore=crx-quickstart/repository/segmentstore --datastore=c:\\dev\\aem\\author\\blobstore crx-quickstart/repository crx-quickstart/repository_new -mmap
- If there is no output errors we should check that crx-quickstart\repository_new contains new Tar files and if indeed:
- create new folder crx-quickstart\install
- delete crx-quickstart\repository
- rename crx-quickstart\repository_new to crx-quickstart\repository
- Create configuration files for new store (options are described here – click):
- create crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg with below content:
customBlobStore=true
- create quickstart\install\org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg with below content:
minRecordLength=4096 path=C:\\dev\\aem\\author\\blobstore cacheSizeInMB=256
- create crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg with below content:
- Run the instance and check that
/system/console/configMgr/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
has checked “Custom BlobStore” checkbox