Thursday, April 21, 2016

AEM Quartz Scheduler Cron Expressions

AEM uses the Quartz Scheduler to configure scheduled services. The full details of the schedule expression can be found at at the Quartz Scheduler Tutorial Lesson 6: CronTrigger.

Wednesday, April 20, 2016

Easier way to find AEM cURL Commands

We've been in the process of automating everything on AEM 6.0 and this means we have to dig around and find the cURL commands that we need to run from our Puppet scripts. I used to follow the technique where I would look for the POST request after clicking a button in AEM, then looking for the URL and what parameters were passed down, then manually compile a cURL command.

This has now all changed!

In Chrome, you can now open the Developer Tools, select the Network Tab, complete your POST request, then right click on the POST URL and select "Copy as cURL". This generates the cURL command! On Chrome Windows, it gives you the option to select a CMD or Bash version.
From here you can strip out what's not necessary and you're good to go!

Tuesday, April 19, 2016

The AEM 6.0 SP2 Author Primary and Standby Switch

I spent a couple hours getting a AEM 6.0 Service Pack 2 Author Standby switched to the Author Primary. The How to Run AEM with TarMK Cold Standby doc gives some great details about to create and configure the TarMK Cold Standby. There was a bit of a fail in the details of switching the Cold Standby to become the Primary.

After a bit of digging I came across Jayan Kandathil's blog post at CQ-OPS: How to Configure an AEM 6 “Cold Standby” Failover Instance and it pointed the the missing step in AEM 6.0.

Assuming that the Author Primary and Standby are active, working and syncing data, the steps to switch the Standby to Primary should go:

  1. Shutdown the Author Primary (it's failed anyway).
  2. Shutdown the Author Standby.
  3. Snapshot/backup the Author Standby crx-quickstart directory (to use when creating the the new Author Standby).
  4. On the Author Standby instance, move (if testing) or delete (if failover) the /crx-quickstart/install/install.standby directory.
  5. On the Author Standby instance, create the /crx-quickstart/install/install.primary directory. Add in the 3 required config files for the Author Primary.
  6. On the Author Standby instance, update the /crx-quickstart/bin/start script and set the runmode from "standby" to "primary"
  7. On the Author Standby instance, start AEM. This is now the Author Primary.
If you don't remove the install.standby, it still starts in Standby mode. In Standby mode, you can access the System Console, but you have no access to the CRXDE or to AEM Sites. Removing the directory is what ensures that it has started as the AEM Primary.