Configuring AEM 6.0 with mongoMK
One of the most important feature of AEM 6.0 is introduction of "Apache Jackrabbit Oak" with this new version of AEM. Jackrabbit oak is an effort to enhance the scalability and performance of the backend of the AEM content reporsitory. Oak introduces the micro-kernel for persistence of repository data, there are two micro-kernel implementation supported with oak :
Tar storage uses tar files for storing the repository content. The content is stored in segments that can be upto 256 MB in size. Segments are immutable which makes it easy to cache frequently accessed segments.
Mongo storage uses Mongo DB to storing the content of the repository. Mongo MK makes oak repository scalable as mongo DB supports sharding and clustering.
In this post I will be discussing how to configure Mongo storage or MongoMK with AEM. Here are the set of steps for setting up mongo MK with AEM :
Setting Up Mongo DB (Ubuntu specific) :
Extract the files from the downloaded archive.
tar -zxvf mongodb-linux-i686-3.0.4-rc0.tgz
Copy the extracted folder to the location from which MongoDB will run.
mkdir -p /opt/mongodb
cp -R -n mongodb-linux-x86_64-ubuntu1404-3.0.3/* /opt/mongodb
Ensure the location of the binaries is in the PATH variable.
Run MongoDB :
mongod (run mongod command from termilnal)
Create the data directory.
mkdir -p /data/db
Set permissions for the data directory.
Before running mongod for the first time, ensure that the user
mongod has read and write permissions for the directory.
mongod or /opt/mongodb/bin/mongod
I used Robomongo which is a client to access Mongo DB server and
perform the manipulations on the mongo DB.
- Unpack AEM by running the following command:
java –jar cq-quickstart-6.0.0.jar -unpack
- Create a folder named crx-quickstart\install in the installation directory.
- Configure the node store by creating a configuration file with the name of the configuration you want to use in the crx-quickstart\install directory.
The Document Node Store (which is the basis for AEM's MongoDB storage implementation) uses a file called org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg.
Here is the sample DocumentNodeStoreService.cfg file :
Start the AEM 6 jar with a MongoDB storage backend by running: