April 20, 2020
Estimated Post Reading Time ~

Creating an AEM TarMK Cold Standby setup

Caution:
The PID for the Segment node store and the Standby store service has changed in AEM 6.3 compared to the previous versions as follows:
  • from org.apache.jackrabbit.oak.plugins.segment.standby.store.StandbyStoreService to org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService
  • from org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService to org.apache.jackrabbit.oak.segment.SegmentNodeStoreService
Make sure you make the necessary configuration adjustments to reflect this change.

In order to create a TarMK cold standby setup, you first need to create the standby instances by performing a file system copy of the entire installation folder of the primary to a new location. You can then start each instance with a runmode that will specify its role (primary or standby).
Below is the procedure that needs to be followed in order to create a setup with one master and one standby instance:

Install AEM.
Shutdown your instance, and copy its installation folder to the location where the cold standby instance will run from. Even if run from different machines, make sure to give each folder a descriptive name (like aem-primary or aem-standby) to differentiate between the instances.

Go to the installation folder of the primary instance and:
  • Check and delete any preivous OSGi configurations you might have under aem-primary/crx-quickstart/install
  • Create a folder called install.primary under aem-primary/crx-quickstart/install
  • Create the required configurations for the prefered node store and data store under aem-primary/crx-quickstart/install/install.primary
  • Create a file called org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.config in the same location and configure it accordingly. For more information on the configuration options, see Configuration.
  • If you are using an AEM TarMK instance with an external data store, create a folder named crx3 under aem-primary/crx-quickstart/install named crx3
  • Place the data store configuration file in the crx3 folder.
If, for example, you are running an AEM TarMK instance with an external File Data Store, you need these configuration files:
  • aem-primary/crx-quickstart/install/install.primary/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.config
  • aem-primary/crx-quickstart/install/install.primary/org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.config
  • aem-primary/crx-quickstart/install/crx3/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config
Below you'll find sample configurations for the primary instance:

Sample of org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. customBlobStore=B"true"
  3. standby=B"false"
Sample of org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. mode="primary"
  3. port=I"8023"
Sample of org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. path="./crx-quickstart/repository/datastore"
  3. minRecordLength=I"16384"
Start the primary making sure you specify the primary runmode:
java -jar quickstart.jar -r primary,crx3,crx3tar

Create a new Apache Sling Logging Logger for the org.apache.jackrabbit.oak.segment package. Set log level to “Debug” and point its log output to a separate log file, like /logs/tarmk-coldstandby.log. For more information, see Logging.

Go to the location of the standby instance and start it by running the jar.

Create the same logging configuration as for the primary. Then, stop the instance.

Next, prepare the standby instance. You can do this by performing the same steps as for the primary instance:
  • Delete any files you might have under aem-standby/crx-quickstart/install.
  • Create a new folder called install.standby under aem-standby/crx-quickstart/install
  • Create two configuration files called:
  • org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.config
  • org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.config
  • Create a new folder called crx3 under aem-standby/crx-quickstart/install
  • Create the data store configuration and place it under aem-standby/crx-quickstart/install/crx3. For this example, the file you need to create is:
  • org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config
  • Edit the files and create the necessary configurations.
Below are sample configuration files for a typical standby instance:
Sample of org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. name="Oak-Tar"
  3. service.ranking=I"100"
  4. standby=B"true"
  5. customBlobStore=B"true"
Sample of org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. mode="standby"
  3. primary.host="127.0.0.1"
  4. port=I"8023"
  5. secure=B"false"
  6. interval=I"5"
  7. standby.autoclean=B"true"
Sample of org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.config
  1. org.apache.sling.installer.configuration.persist=B"false"
  2. path="./crx-quickstart/repository/datastore"
  3. minRecordLength=I"16384"
Start the standby instance by using the standby runmode:
java -jar quickstart.jar -r standby,crx3,crx3tar

The service can also be configured via the Web Console, by:
  • Going to the Web Console at http://localhost:4502/system/console/configMgr
  • Looking for a service called TarMK Cold Standby service and double click it to edit the settings.
  • Saving the settings, and restarting the instances so the new settings can take effect.

Note:
You can check the role of an instance at any time by checking the presence of the primary or standby runmodes in the Sling Settings Web Console.
This can be done by going to http://localhost:4502/system/console/status-slingsettings and checking the "Run Modes" line.

Reference URL: https://helpx.adobe.com/experience-manager/6-4/sites/deploying/using/tarmk-cold-standby.html#CreatinganAEMTarMKColdStandbysetup


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.