压缩AEM repository

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了压缩AEM repository相关的知识,希望对你有一定的参考价值。

https://www.netcentric.biz/blog/2015/02/tarmk.html

 

Growth of repositories in CQ, and now AEM, have always been a pain point for most operations teams, and it is sometimes not clear where the problem stems from. It‘s possible that wrong filters may have been applied, too many nodes were created, or huge renditions were also produced. Other times, it may even be a bug. In any case, Adobe has released the offline compaction method last year which is working great, and they also introduced the online compaction method. Online compaction allows you to trigger a repository compaction from within a running AEM instance via the brand new Operations & Maintenance Dashboard. It also lets you easily schedule it to ensure you have no performance hits during peak usage. Actions in the Dashboard can also be triggered via other means besides the web browser so automation of various processes is a goal that can now be achieved.

ONLINE COMPACTION

Before running any compactions make sure you have a consistent backup you can easily restore to in case its needed. These features are hot off the press!

 

1.  First,  get the latest hotfix of Oak which provides you this functionality from the package share for AEM 6.0 (Oak 1.0.22), with AEM 6.1 (Oak 1.2.7) it is built in!

2.  Install it (there is a restart of AEM required afterwards) don‘t restart just stop after it is finished (make sure you tail the logs!)

3.  ssh into your machine and use the oak-run.jar matching your oak version to clean up old checkpoints

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

4.  To clean up the checkpoints follow the steps below

            java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore

            java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore rm-all

5.  Now start your AEM again and go to the system console -> JMX -> search for "CompactionStrategy"

6.  Make sure the PausedCompaction is set to false as well as CloneBinaries

7.  Go to the maintenance dashboard -> http://localhost:4502/libs/granite/operations/content/maintenance/window.html/mnt/overlay/granite/operations/config/maintenance/_granite_daily

8.  On there trigger the revision cleanup and tail to logs for progress

9.  The log‘s will tell you how much it cleaned up but you can allways check with -> du -h --max-depth=1 and compare before and after results of your repository folder

If your curious about more functionality (backup etc.) of the oak-run.jar have a look on the jackrabbit github -> https://github.com/apache/jackrabbit-oak/tree/trunk/oak-run

技术分享

OFFLINE COMPACTION

Offline compaction can be used any time the AEM instance is stopped. This is also a prerequisite to running online compaction if you haven‘t removed old checkpoints previously.

To see the full effect of the online compaction later, just remove the checkpoints and don‘t actually run the offline compaction.

                java -jar oak-run.jar checkpoints your-install-folder/crx-quickstart/repository/segmentstore

  • Next, delete the unreferenced checkpoints

                java -jar oak-run.jar checkpoints your-install-folder/crx-quickstart/repository/segmentstore rm-all

  • The final step is to run the compaction and wait for it to complete (tail the logs!)

                java -jar oak-run.jar compact your-install-folder/crx-quickstart/repository/segmentstore

CLOSING WORDS OF WISDOM

Make sure you keep track of repository growth as it can easily impact performance or cause a possible outage of the instance due to the system running out of storage space.

With AEM 6, Service Pack 1 and Service Pack 2 are a necessity and should be installed. The later hotfix mentioned applies the latest Oak Fixes and raises it to a version of 1.0.11 of the Oak Core.

Note that some Service Packs and Hotfixes, such as the one for Oak, require a restart! Ensure it gets thoroughly tested beforehand, and plan it into your continuous release cycle for the next deployment to stay up to date. 

 

UPDATE 16.03.2015:

1. If interested in details of the hotfixes have a look on Adobes Hotfix Page

2. A new Hotfix 5916 was released which addreses some possible issues with the Oak garbage collection

以上是关于压缩AEM repository的主要内容,如果未能解决你的问题,请参考以下文章

sh AEM 6. + - 用于终止AEM java进程的kill命令。

aem中的橡木版本升级

AEM 6.3:使用 Oauth 登录

如何在 AEM 作为云中创建后台作业?

AEM 6.2 - 使用 Web 组件(聚合物)和 Angular

AEM 创作自动化 - 无法定位元素