Reindexing Oak Async Indexes on a Clone AEM Instance
How to Reindex AEM on a Clone Instance and Sync over the Changes
java -Xmx4096m -jar oak-run-1.0.23.jar checkpoints /path/to/repository/segmentstore
java -Xmx4096m -jar oak-run-1.0.23.jar checkpoints /path/to/repository/segmentstore rm-all
nohup java -Dtar.memoryMapped=true -Dupdate.limit=5000000 -Dcompaction-progress-log=1500000 -Dcompress-interval=10000000 -Doffline-compaction=true -Xmx10g -jar oak-run-1.0.23.jar compact crx-quickstart/repository/segmentstore > tarcompaction.log 2>&1 &
java -Xmx4096m -jar oak-run-1.1.8.jar console crx-quickstart/repository/segmentstore
:load rmNode.groovy
rmNode(session, "/:async")
rmNode(session, "/oak:index/lucene")
:exit
These show that the indexing started:
17.11.2015 16:22:18.481 *INFO* [FelixStartLevel] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing would be performed for following indexes [/oak:index/cqCloudServiceConfig, /oak:index/slingeventEventId, /oak:index/cqPayloadPath]
17.11.2015 16:22:26.624 *INFO* [pool-70-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing would be performed for following indexes [/oak:index/damFileSize, /oak:index/cqLastModified]
17.11.2015 16:30:38.060 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Found a new index node [damFileSize]. Reindexing would be requested
17.11.2015 16:30:38.074 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Found a new index node [cqLastModified]. Reindexing would be requested
17.11.2015 16:30:38.074 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing would be performed for following indexes [/oak:index/damFileSize, /oak:index/lucene, /oak:index/cqLastModified]
These messages show indexing progress:
17.11.2015 16:31:04.293 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #220000 /libs/granite/i18n/pt-br/Last build_
17.11.2015 16:31:05.603 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #230000 /libs/granite/security/content/groupEditor/items/page/items
If you see this log message then it completed successfully:
17.11.2015 16:31:08.294 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate Reindexing (async) completed for indexes: [/oak:index
/damFileSize*(93), /oak:index/lucene*(237527), /oak:index/cqLastModified*(1525)] in 30.24 s
If you never saw a "completed" log message and this log message shows up again (or similar "Reindexing would be ..." message) then it means indexing failed and has gone in a loop:
17.11.2015 16:30:38.074 *INFO* [pool-9-thread-5] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing would be performed for following indexes [/oak:index/damFileSize, /oak:index/lucene, /oak:index/cqLastModified]
If it failed then go to /system/console/slinglog UI and enable Debug level logging for org.apache.jackrabbit.oak.plugins.index. The next time the indexing loops (showing "Reindexing would be performed" you would see a log message before the error showing an error indicating why indexing failed. Contact Adobe AEM Customer Care and provide them that log file.
//element(*,cq:PageContent)[@cq:lastModified >= xs:dateTime('2015-09-16T00:00:00.000-05:00')]
//element(*, dam:AssetContent)[@jcr:lastModified > xs:dateTime('2015-09-16T00:00:00.000-05:00')]
//element(*, cq:Tag)[@jcr:created > xs:dateTime('2015-09-16T00:00:00.000-05:00')]