Chuyển đến nội dung chính

[CQ6-SYSTEM] MAINTAINING THE REPOSITORY - Reduce repository size (cleanup repository)

Compacting Tar Files

As data is never overwritten in a tar file, the disk usage increases even when only updating existing data. To make up for the growing size of the repository, AEM employs a garbage collection mechanism called Tar Compaction. The mechanism will reclaim disk space by removing obsolete data from the repository.

Revision Clean Up

By default, tar file compaction is automatically run each night between 2 am and 5 am. The automatic compaction can be triggered manually in the Operations Dashboard via a maintenance job called Revision Clean Up.

To start Revision Clean Up you need to:
  1. Go to the AEM Welcome Screen.
  2. In the main AEM window, go to Tools - Operations - Dashboard - Maintenance or directly browse tohttp://localhost:4502/libs/granite/operations/content/maintenance.html
  3. Click on Daily Maintenance Window.
  4. Hover over the Revision Clean Up window and press the Start button.
file

The icon will turn orange to indicate that the Revision Clean Up job is running. You can stop it at any time by hovering the mouse over the icon and pressing the Stop button:
file

Invoking Revision Garbage Collection via the JMX Console

  1. Open the JMX Console by going to http://localhost:4502/system/console/jmx
  2. Click the RevisionGarbageCollection MBean.
  3. In the next window, click startRevisionGC() and then Invoke to start the Revision Garbage Collection job.

NOTE
Due to the mechanics of the garbage collection, the first run will actually add 256 MB of disk space. Subsequent runs will work as expected and start shrinking the repository size.

Offline Compaction via the Oak-run Tool

For faster compaction of the Tar files  (e.g. to trim none-production env) and situations where normal garbage collection doesn't work, Adobe provides a manual Tar compaction tool called Oak-run. It can be downloaded here:
http://mvnrepository.com/artifact/org.apache.jackrabbit/oak-run

CAUTION
Different versions of the Oak-run tool need to be used depending on the Oak version you use with your AEM installation. Please check the version requirements list below before using the tool:
For Oak versions 1.0.0 through 1.0.11 or 1.1.0 through 1.1.6, use Oak-run version 1.0.11
For Oak versions newer than the above, use the version of Oak-run that matches the Oak core of your AEM installation.

Open CRX DE Lite to see oak version (http://localhost:4502/crx/de/index.jsp)


The tool is a runnable jar that can be manually run to compact the repository. The procedure is called offline compaction because the repository needs to be shut down in order to properly run the tool.
Normal operation of the tool also requires old checkpoints to be cleared before the compaction takes place.
The procedure to run the tool is:
  1. Shut down AEM.
  2. Use the tool to find old checkpoints:
java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore
  1. Then, delete the unreferenced checkpoints:
java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore rm-unreferenced
  1. Finally, run the compaction and wait for it to complete:
java -jar oak-run.jar compact install-folder/crx-quickstart/repository/segmentstore

Ref: http://mvnrepository.com/artifact/org.apache.jackrabbit/oak-run

Nhận xét

Bài đăng phổ biến từ blog này

How to custom CQ Login Module

In order to manage the login process in our project, we will use a custom CQ Login Module. We will admit the root URL of CQ instance is: http://localhost:4502/ . This value may change depending of your environment. The %CQ_HOME% variable we will mention refers to the CQ install path. It admits you have defined %CQ_HOME% as an environment variable. 1.         Update the repository definitions The login module must be referenced in the repository definitions. You have to edit the next file: %CQ_HOME%/crx-quickstart/repository/repository.xml Do a copy of repository.xml to repository.xml.original In repostiory.xml, replace  security  part of repository.xml with following: <Security appName="com.day.crx">         <SecurityManager class="com.day.crx.core.CRXSecurityManager"> <WorkspaceAccessManager class="org.apache.jackrabbit.core.security.simple.SimpleWorkspaceAccessManager"/>  ...

[DAM] Custom DAM management / Add 'Alt' into images

Issue: We need, for each asset to be able to edit the ‘alt’ text. The ‘alt’ text must be used on the site each time an asset is displayed. When displaying an asset, the mechanism is the following : -       Get the Locale from the request -       When getting the asset, get the associated Alt property corresponding to the locale. -       Populate the alt attribute with this value. Resolution: To achieve this, we can customize the DAM Asset Editor. The AssetEditor is the form used to input asset properties and metadata. Below is a screenshot of a customized form with four “alt” input (for four different locales). The DAM uses the following nodes to render Asset Editor forms: -       /libs/dam/content/asseteditors/formitems -       /libs/dam/content/asseteditors/images/formitems -      ...

[CONFIGURATION] Change default start page

Change the default startup page from projects.html to welcome on login in Adobe CQ 5.6 and above. CQ5.6 introduced responsive layout and the landing page after logging into the author instance goes to the new touch friendly interface. However, as a developer I prefer the old interface where I can quicky navigate to any of the options. Author instance: So to change the landing page post login in the Author instance to go to the welcome page here’s what you need to do Go to CRX Explorer Interface http://localhost:4502/crx/explorer/browser/index.jsp Navigate to the node /libs/cq/core/config. author /com.day.cq.commons.servlets.RootMappingServlet Right click the rootmapping.target property and select edit. Change the value to /welcome.html Click Save All Publish instance: Go to CRX Explorer Interface http://localhost:4502/crx/explorer/browser/index.jsp Navigate to the node /libs/cq/core/config. publish /com.day.cq.commons.servlets.RootMappingServlet R...