Configure Data Store and Node Store in AEM 6

In this article we are going to learn how to configure Data Store and Node Store in AEM 6. We all know how to install AEM, but it’s really important to know which type of configurationĀ is best for which type of scenario. What are the different ways to configureĀ data store and node store in AEM 6.1.

Major difference between CQ5.x and AEM6.x:

  • AEM6.x implements OAK repository whereas older CQ5 uses CRX2.
  • AEM6.x uses Microkernel , CQ5.x uses Persistence manager.
  • Custom re-index is possible in AEM 6.x depends upon the queries . (Will cover more on this in later article)
  • Slightly is introduced in AEM6.x whereas CQ5 uses JSP.

Prerequisite:

  • AEM 6.1 jar Ā with valid License file.
  • Decide which Node and Data store is required for your project.

Configure different Data Store in AEM 6:

There are basically two type of data store available in AEM 6Ā Amazon S3 bucket andĀ FileĀ Data store.

data store types aem 6.1

Amazon S3 Bucket Ā Data Store :

This type of storage requires account with Amazon. We need this type to store more data’s in an external S3 bucket.

Config file name :

org.apache.jackrabbit.oak.plugins.blob.datastore.S3DataStore.config

Basic config:

accessKey=<provided by Amazon>

secretKey=<provided by Amazon>

s3Bucket=<provided by Amazon>

s3Region=<provided by Amazon>

s3EndPoint=<provided by Amazon>

connectionTimeout=120000

socketTimeout=120000

maxConnections=40

maxErrorRetry=10

writeThreads=20

cacheSize=<size in bytes>

concurrentUploadsThreads=10

asyncUploadLimit=100

cachePurgeTrigFactor=0.95d

path=~/datastore

File Data store:

This method is required to store all binary data in same local file system .

Config file name :

org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config

Basic config:

path=~/datastore

minRecordLength=<values in bytes>

Configure Node Store types in AEM 6:

node store types aem 6.1

Document Node store:

This type needs to configure MONGODB. Mongo DB setup is configured for HA of instances.

Config file name :

org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.config

Basic config:

mongouri=mongodb://<hostname>:<port>

db=<db name>

customBlobStore=false

Feel free toĀ drop a comment,Ā if you face any issue while implementing mongoDB .

Segment node store:

This method uses to store Metadata , properties in TARMK implementation. By default AEM uses segment store.

Same article contains offline compaction details below.

Config file name :

org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config

Basic config:

customBlobStore=true

NOTE: By default , segment store folder creates under /repository folder.If still needs to change the path , we can use repository.home in config file.

Steps to install AEM 6:

  • Move Jar and license file to appropriate folder.
  • Rename jar file asĀ  ā€œcq6-p<portnumber>.jarā€Ā  # specify port number 4 or 5 digit
  • Just Unzip the jar file

Java ā€“jar cq6-p<portnumber>.jar ā€“unpack

Sample output:

[pradeep@host ~]$ <strong>java -jar cq6-author-p4507.jar -unpack</strong>

Loading quickstart properties: default

Loading quickstart properties: instance

Setting properties from filename '/home/pradeep/cq6-author-p4507.jar'

Option '-quickstart.server.port' set to '4507' from filename cq6-author-p4507.jar

Verbose mode - stdout/err not redirected to files, and stdin not closedResourceProvider paths=[/gui, /gui/default]

quickstart.build

quickstart.properties not found, initial install

UpgradeUtil.handleInstallAndUpgrade has mode INSTALL

Saving build number in quickstart.properties

Upgrade: no files to restore from pre-upgrade backup

31 files extracted from jar file

Running chmod +x /home/pradeep/crx-quickstart/bin/start

Running chmod +x /home/pradeep/crx-quickstart/bin/stop

Running chmod +x /home/pradeep/crx-quickstart/bin/status

Running chmod +x /home/pradeep/crx-quickstart/bin/quickstart

Not starting the Quickstart server as the -unpack option is set

Quickstart files unpacked, server startup scripts can be found under /home/pradeep/crx-quickstart
  • Once extracted properly, check crx-quickstart folder present in the same path
  • Inside Crx-quickstart folder , create a folder named as ā€œinstallā€ folder.
  • As per above configuration , create config file and configuration.
  • Once done, start the instance.
  • Check all bundles are in active state and review the error log.

Issues while configuring S3 bucket:

After all config made as per above, we faced issues related to Amazon configĀ  andĀ  local cache pathĀ  not created properly.

After lots of verification on config file, we finally identified as the config made under install folder is not override on our OSGI console.

OpenĀ  config similar to your setup and verify the configuration override properly.

S3 bucket data store configuration aem 6

Sample S3 config :

S3 bucket sample data store configuration aem 6

Sample Segment store config:

sample segment node store service aem 6.1

Offline compaction :

Few may face issues with disk space issue on Segment store folder .

To reduce space , AEM has provided with compaction tool. This post explains about offline compaction techniques.

Steps to perform offline compaction:

  • Ā Download and install latest oak-run . Please visit below URL to check the updates
    https://repository.apache.org/content/repositories/releases/org/apache/jackrabbit/oak-run/
  • Stop the AEM instance.
  • Backup the instance .
  • Check the size before running command
  • Run the below command
    • java -jar oak-run-x.x.xx.jar checkpoints <segmentstore path>
    • java -jar oak-run-x.x.xx.jarĀ  checkpoints <segmentstore path> Ā rm-unreferenced
    • java -jar oak-run-x.x.xx.jarĀ  compact <segmentstore path>
  • Start the instance.
  • Check the segment store size.

Explanation:

  • First command will identify the older checkpoints.
  • Second command, checks for unreferenced checkpoints and remove them
  • Compact the segment store.

NOTE: Once you are familiar with these steps , please implement in script .

Feel free to drop a comment or write to usĀ on mongo DB setup and configuration related issues.

 

Spread the love

Leave a Reply to Pankaj Rohira Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.