2

I am trying to configure the FileDataStore on my local environment on an AEM 6.5.4 Author instance. That said contrary to what the documentation indicates :

File Data Store

This is the implementation of FileDataStore present in Jackrabbit 2. It provides a way to store the binary data as normal files on the file system. It uses the org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore PID. These configuration options are available:

  • repository.home : Path to repository home under which various repository related data is stored. By default, binary files would be stored under crx-quickstart/repository/datastore directory

  • path : Path to the directory under which the files would be stored. If specified then it takes precedence over repository.home value

  • minRecordLength : The minimum size in bytes of a file stored in the data store. Binary content less than this value would be inlined.

I can’t seem to find the repository.home nor the minRecordLength configuration options in my Apache Console local environment (see screenshot).

enter image description here

I have noticed the configuration popup window displays the following text:

This form is automatically generated from existing properties because no property descriptors are available for this configuration. This may be cause by the absence of the OSGi Metatype Service or the absence of a MetaType descriptor for this configuration. I'm not exactly sure what this mean though or if it is related to the issue at hand.

Some guidance on this particular issue is welcomed as I have never configured an AEM FileDataStore. Thanks.

Community
  • 1
  • 1
nabello
  • 716
  • 11
  • 29

1 Answers1

1

The OSGi console is the wrong place for this anyway. I was even not aware, that this OSGi config exists.

The file data store is configured as a framework property. Therefore put in your sling-home directory (= crx-quickstart for AEM) an install folder, and there an file named org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg.

Here is a real-world example from me. I use this, that my author and publishers share the same datastore. This saves some disk-space (I need a lot of assets locally).

path=C:\\aem64\\filedatastore

You have to put these settings, before you install AEM. Otherwise your repository is corrupted. Here is an excerpt of my local install-script, to setup a new instance:

  echo "Create directory `pwd`/${AEM_DIR}"
  mkdir ${AEM_DIR}
  cd ${AEM_DIR}/

  echo "Copy license file"
  cp ../install-files/license.properties .

  echo "Unpack AEM_6.4_Quickstart.jar"
  java -jar ../install-files/AEM_6.4_Quickstart.jar -unpack

  echo "Copy install folder"
  mkdir crx-quickstart/install
  cp ../install-files/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg crx-quickstart/install/

  if [ ! -d ../filedatastore ]; then
    echo "create filedatastore"
    mkdir ../filedatastore
  fi
  if [ ! -f ../filedatastore/reference.key ]; then
    echo "init filedatastore with reference.key"
    cp ../install-files/reference.key ../filedatastore/
  fi
fi

For more information look here: https://jackrabbit.apache.org/oak/docs/osgi_config.html#config-sling

PS: The reference.key file is generated automatically. You only need a pre-shared file for binary less replication.

Alexander Berndt
  • 1,628
  • 9
  • 17
  • Thanks for this solution! I want to do this with using the vanilla Apache Sling Starter jar. If you have ideas, please let me know https://stackoverflow.com/questions/63569028/add-new-datastore-during-upgrade – Cris Rockwell Aug 25 '20 at 15:27