Thursday 16 July 2015



The major change that AEM6 has, is at its repository level.Till CQ 5.6 version TarPM was used as a persistence manager but with AEM 6 TarPM is not supported any more by CQ. AEM 6 now comes with the MicroKernels which act as persistence managers in AEM 6. 
For now AEM 6 support TarMK and MongoMK Microkernal. 
Below are the steps taken to install AEM 6 with MongoMK.
Basic Requirements:
Install the latest 1.7 JDK (Oracle)
Download mongodb in zip or in msi for windows from https://www.mongodb.org/downloads
[MongoDB]
1) Install MongoDB msi(NOTE: Version 2.6.1 or better is required) OR in case of zip, unzip it at C:\MongoDB\
2) Create two more folders \data and \log (at the same level as \bin)
3) Create a new configuration file named as mongod.cfg (at same level in which data and log folders are present) as following:
port = 27017
quiet = false
dbpath = C:\MongoDB\Server\3.0\data
logpath = C:\MongoDB\Server\3.0\log\mongod.log
logappend = true
journal = true
directoryperdb = true
rest=true
httpinterface=true
profile=2
4) Start MongoDB using the command:
 mongod.exe --config C:\MongoDB\Server\3.0\mongod.cfg
5) Check C:\MongoDB\log\mongod.log for entries that look like the following:

02T11:56:40.640+0530 I CONTROL  [initandlisten] options: { config: "C:\MongoDB\Server\3.0\mongod.cfg", net: { http: { RESTInterfaceEnabled: true, enabled: true }, port: 27017 }, operationProfiling: { mode: "all" }, storage: { dbPath: "C:\MongoDB\Server\3.0\data", directoryPerDB: true, journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "C:\MongoDB\Server\3.0\log\mongod.log", quiet: false } }
 admin web console waiting for connections on port 28017
 INDEX    [initandlisten] allocating new ns file C:\MongoDB\Server\3.0\data\local\local.ns, filling with zeroes...
 I STORAGE  [FileAllocator] allocating new datafile C:\MongoDB\Server\3.0\data\local\local.0, filling with zeroe I STORAGE  [FileAllocator] creating directory C:\MongoDB\Server\3.0\data\local\_tm
 I STORAGE  [FileAllocator] done allocating datafile C:\MongoDB\Server\3.0\data\local\local.0, size: 64MB,  took 0.141 secs
 I NETWORK  [initandlisten] waiting for connections on port 27017

[AEM 6.0]
1) Unpack AEM with the command:
java -jar aem6-author-p4502.jar -unpack 
2) Go to  /crx-quickstart/bin 
3) Open the start.bat file and add the below two points:
Set the runmode as CQ_RUNMODE=author,crx3mongo
The oak.mongo.uri JVM argument:
-Doak.mongo.uri=mongodb://<serverName>:27017
Eg: CQ_JVM_OPTS=-server -Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -Doak.mongo.uri=mongodb://localhost:27017
4) Start AEM using the start.bat file and watch both the MongoDB log and the AEM log
NOTE: For the first time startup of AEM 6.0 on MongoDB will be slow
5) In the MongoDB log, there should be some entries like these:
2015-07-02T12:11:36.541+0530 I WRITE    [conn4] insert aem-author.system.indexes keyUpdates:0 writeConflicts:0 numYields:0 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, MMAPV1Journal: { acquireCount: { w: 9 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 96 } }, Database: { acquireCount: { W: 1 } }, Collection: { acquireCount: { W: 1 } }, Metadata: { acquireCount: { W: 5 } } } 893ms
2015-07-02T12:11:36.591+0530 I STORAGE  [FileAllocator] allocating new datafile C:\MongoDB\Server\3.0\data\aem-author\aem-author.1, filling with zeroes...
2015-07-02T12:11:37.460+0530 I STORAGE  [FileAllocator] done allocating datafile C:\MongoDB\Server\3.0\data\aem-author\aem-author.1, size: 512MB,  took 0.868 secs

6) Login to AEM 6.0 at http://localhost:4502 and it should open as usual but with mongodb.