Mongo Storage

Running a freshly installed AEM instance with Mongo Storage

AEM 6 can be configured to run with MongoDB storage by following the below procedure:

  1. Download the AEM 6 quickstart jar and place it into a new folder.

  2. Unpack AEM by running the following command:

    java -jar cq-quickstart-6.jar -unpack

  3. Make sure that MongoDB is installed and an instance of mongod is running. For more info, see Installing MongoDB.

  4. Create a folder named crx-quickstart\install in the installation directory.

  5. Configure the node store by creating a configuration file with the name of the configuration that 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

  6. Edit the file and set your configuration options. The following options are available:

    • mongouri: The MongoURI required to connect to Mongo Database. The default is mongodb://localhost:27017
    • db: Name of the Mongo database. By default new AEM 6 installations use aem-author as the database name.
    • cache: The cache size in megabytes. This cache size is distributed among various caches used in DocumentNodeStore. The default is 256.
    • changesSize: Size in MB of capped collection used in Mongo for caching the diff output. The default is 256.
    • customBlobStore: Boolean value indicating that a custom data store is used. The default is false.
  7. Create a configuration file with the PID of the data store you want to use and edit the file to set the configuration options. For more info, see Configuring Node Stores and Data Stores.

  8. Start the AEM 6 jar with a MongoDB storage backend by running:

    java -jar cq-quickstart-6.jar -r crx3,crx3mongo
    

    Where the backend run mode is -r, the example starts with MongoDB support.

Disabling Transparent Huge Pages

Red Hat® Linux® uses a memory management algorithm called Transparent Huge Pages (THP). While AEM performs fine-grained reads and writes, THP is optimized for large operations. Therefore, it is recommended that you disable THP both on Tar and Mongo storage. To disable the algorithm, follow these steps:

  1. Open the /etc/grub.conf file in the text editor of your choice.

  2. Add the following line to the grub.conf file:

    transparent_hugepage=never
    
  3. Finally, check if the setting has taken effect by running:

    cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
    

    If THP is disabled, the output of the above command should be:

    always madvise [never]
    
NOTE
Consult the following resources:

Maintaining the Repository

Each update to the repository creates a content revision. As a result, with each update the size of the repository grows. To avoid uncontrolled repository growth, old revisions must be cleaned up to free disk resources. This maintenance functionality is called Revision Cleanup. The Revision Cleanup mechanism reclaims disk space by removing obsolete data from the repository. For further details about Revision Cleanup, read the Revision Cleanup page.

Experience Manager


Elevate and Empower Teams with Agentic AI for Exceptional Experiences

Online | Strategy Keynote | General Audience

Elevate and empower your CX teams with AI that transforms creativity, personalization, and productivity. Discover how Adobe is...

Tue, Mar 18, 1:00 PM PDT (8:00 PM UTC)

Register

3 Pillars of Purpose-driven Experiences: Trust, Data, and GenAI

In-person | Session | General Audience

Learn how leading B2B and B2C brands like AT&T and IBM are intersecting data, GenAI and trust to build “purpose-driven” experiences that...

Wed, Mar 19, 1:00 PM PDT (8:00 PM UTC)

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more