压缩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

时间: 2024-10-09 14:25:38

压缩AEM repository的相关文章

elk的备份与恢复

elasticsearch提供了快照功能: 1.在elsticsearch的配置文件中定义一个path.repo路径配置 path.repo: ["/elk/my_backup"] 重新启动elasticsearch服务 创建备份的文件夹并赋予权限 mkdir -p /elk/my_backup chmod 755 /elk/my_backup chown -R elasticsearch.elasticsearch /elk/* 创建repository: curl -XPUT 'h

使用gulp压缩js详细步骤笔记

先要安装nodejs,初始化项目配置文件package.json,根据情况输入配置参数 npm init 1 test command: 2 git repository: 3 keywords: 4 author: 5 license: (ISC) 6 About to write to E:\temp\20170429\test03\package.json: 7 8 { 9 "name": "test03", 10 "version": &

Jcompress: 一款基于huffman编码和最小堆的压缩、解压缩小程序

前言 最近基于huffman编码和最小堆排序算法实现了一个压缩.解压缩的小程序.其源代码已经上传到github上面: Jcompress下载地址 .在本人的github上面有一个叫Utility的repository,该分类下面有一个名为Jcompress的目录便是本文所述的压缩.解压缩小程序的源代码.后续会在Utility下面增加其他一些实用的小程序,比如基于socket的文件断点下载小程序等等.如果你读了此文觉得还不错,不防给笔者的github点个star, 哈哈.在正式介绍Jcompres

linux常见的压缩和解压缩管理工具!

1.tar.gz&tar.bz(gzip和bzip就算了) yum install tar -y [[email protected] ~]# rpm -qa|grep tar upstart-0.6.5-13.el6_5.3.x86_64 tar-1.23-11.el6.x86_64 selinux-policy-targeted-3.7.19-260.el6.noarch [[email protected] ~]# 2.xz  yum install xz -y [[email prote

大数据处理时用到maven的repository

由于做数据处理时,经常遇到maven 下载依赖包错误,下面我将自己下载好的repository 分享下 里边包含:Hadoop ,storm ,sprk ,kafka ,等 压缩后500多M. http://pan.baidu.com/s/1pJN2ScV 如有问题请联系: [email protected]

第九章、文件与文件系统的压缩与打包 Linux 系统常见的压缩命令

Linux 系统常见的压缩命令: 在Linux中,压缩文件的扩展名大多是:『*.tar, *.tar.gz, *.tgz, *.gz, *.Z, *.bz2』 Linux 支持的压缩命令非常多,且不同的命令所用的压缩技术并不相同,彼此之间可能就无法相互压缩/解压缩文件. 所以,当你下载到某个压缩档时,自然就需要知道该文件是由哪种压缩命令所制作出来的,好用来对照著解压缩!虽然 Linux 文件的属性基本上是与档名没有绝对关系的, 但是为了帮助我们人类,所以适当的扩展名还是必要的! *.Z comp

使用Snappy 压缩方式报错“java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path”

情况描述 其实这个问题已经困扰我很久了,最近在公司Linux上搭建hadoop 和 spark环境的时候,我就遇到 spark提交作业到yarn 集群就报错这个错,当时已经安装snappy环境了,任何关于snappy静态库都编译了,这是我提交到spark mail list上的http://apache-spark-user-list.1001560.n3.nabble.com/java-lang-UnsatisfiedLinkError-no-snappyjava-in-java-librar

初了解Oracle 11g的Automatic Diagnostic Repository新特性

Oracle 11g之前,当数据库出现问题时,往往第一时间需要看alert日志,看看里面记录了哪些错误,可以给我们提示.alert文件名则 是alert_<ORACLE_SID>.log,文件存储路径由参数background_dump_dest决定,例如: SQL> show parameter background_dump_dest NAME                                            TYPE         VALUE --------

gulp压缩构建代码

// 获取 gulp var gulp = require('gulp'); // 获取 uglify 模块(用于压缩 JS) var uglify = require('gulp-uglify'); // 获取 htmlminify 模块(用于压缩 html) var htmlminify = require("gulp-html-minify"); // 获取 minify-css 模块(用于压缩 CSS) var minifyCSS = require('gulp-minify-