Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Sling Content Distribution in AEM (Part 3) — Sync Distribution | Sync Content between Publishers in AEM as a Cloud Service

This tutorial is the continuation of earlier tutorials on Sling Content Distribution in AEM, refer the following URL for part 1 and part 2 tutorials.

This tutorial is created based on AEM as Cloud Service Local Author and Publish Instances. The social user sync module is removed from AEM as Cloud due to that some additional configurations required to enable the sync distribution between publishers.

I am using the OSGi system console to enable the required configurations for the demo, use run mode specific OGGI configurations while implementing content distribution in the project.

Sling Content Distribution in AEM (Part 1) — Forward Distribution

The Sling Content Distribution (SCD) module allows one to distribute Sling resources between different Sling instances…

medium.com

Sling Content Distribution in AEM (Part 2) — Reverse Distribution

This tutorial is the continuation of earlier tutorial on Sling Content Distribution in AEM, refer the following URL for…

medium.com

In this tutorial let us see the details on Sling Sync Distribution on AEM.

Sync Distribution — Definition

  • Sync distribution allows modifications made on one publish instance to be synchronized with other publish instances in the farm of publish instances via author instance
  • The modifications automatically synchronized across the publish instances in the farm and are not created on the author.
  • That is done by the author pulling the content from source instance(publish) and distribute it to the other publish instances on the farm.
  • Sling distribution only sends the modification data to non-originating publish instances, eliminating unnecessary traffic
  • The author pulls resources from n publish instances and push them to n-1 publish instances in the farm.

This will helps us to sync the data generated in n publish instances to (n-1) publish instances other than the source publish instance in a farm through Author instance as a coordinator but without creating the content in Author.

Sync Distribution — Configurations

Configure a local importer, agent-based exporter and a “queue” agent on all the publish instances

org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-sync.json

name=“sync”

org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-pubsync.json

name=”pubsync

org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-pubsync.json

name=”pubsync”

Configure a “sync distribution” agent on the author(coordinator instance)

org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory

name=“distribution-sync”

packageExporter.endpoints — pointing to the URL of the exporter on publish instance, configure the endpoints of all the publishers in the farm

packageImporter.endpoints — pointing to the URL of the importer on publish instance, configure the endpoints of all the publishers in the farm

Sync Distribution — Demo

  • Configure Authorized User
  • Adobe Granite Distribution — Encrypted Password Transport Secret Provider
  • Configure Queue agent and importer on Publisher
  • Configure Sync Distribution Agent on Author
  • Enable Triggers — Scheduled/JCREvent
  • Test — CURL/Triggers

Let us now see how to use the sync distribution to sync the content modifications between publish instances through Author instance(Coordinator) without creating the modifications in Author instance. The sync distribution can be used to sync any data between the farm of publishers.

Configure Authorized User

Create a new user with name — “usersync-admin” and add this user to the administrator group

Follow the amove steps in all the publish instances

Adobe Granite Distribution — Encrypted Password Transport Secret Provider

Once the authorized user is configured in all the publishers, enable Encrypted Password Transport Secret Provider in Author instance, this user will be used to sync the content between Author and Publish instances.

Access "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4502/system/console/configMgr

Create new configuration for factory “Adobe Granite Distribution — Encrypted Password Transport Secret Provider

name=”distributionsync-publishuser”

username=”usersync-admin”

encryptedPassword= usersync-admin> — Encrypt the password through "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4502/system/console/crypto

Follow the below steps before encrypting the password to sync the hmac and master files from Author to all the publish instances.

  • Find the bundle Id in Author for com.adobe.granite.crypto.file, for example, 36 by navigating to /system/console/bundles/com.adobe.granite.crypto.file to see the Id.
  • Navigate to /crx-quickstart/launchpad/felix/bundle/data in the Author file system.
  • Copy the two files: hmac and master from the Author instance to the publish instances.
  • Restart the com.adobe.granite.crypto bundle or the complete Publish instances.

Configure importer, exporter and Queue agent on Publishers

Configure a queue agent that places the changes into the queues, an exporter that exports packages from the queue agent and importer that imports packages from the queue agent.

Access "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4503/system/console/configMgr

Create new configuration for factory “Apache Sling Distribution Agent — Queue Agents Factory”

Enter a name =“pubsync”
Title=“pubsync”
Check=“Enabled”
Service Name=Service name is optional, if required create a service user with the required permission
Change the log level if required
Allowed Roots=Add the root paths the agent is responsible for distribution e.g required multiple root paths can be configured ) e.g. [/content/we-retail/us]

Now the Queue Agent factory is enabled, the agent can be managed through Tools — Deployments — Distribution

Let us now configure a local importer

Access "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4503/system/console/configMgr

Create new configuration for factory “Apache Sling Distribution Importer — Local Package Importer Factory”

name=”sync”

Let us now configure an agent-based exporter

Access "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4503/system/console/configMgr

Create new configuration for factory “Apache Sling Distribution Exporter — Agent Based Package Exporter

name=”pubsync”
agent.target=”(name=pubsync)”

Repeat the above(configuring Queue agent, importer, and exporter)steps on other publishers in the farm

Configure Sync Distribution Agent on Author

Configure a Sync Distribution Agent in Author that will PULL the content from publishers(exporters) endpoints based on the configuration and distribute the content to the publishers other than the source.

Access "); background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; text-decoration-line: none;' target="_blank">http://localhost:4502/system/console/configMgr

Create new configuration for factory “Apache Sling Distribution Agent — Sync Agents Factory”

Enter a name=“distribution-sync”
Title =“distribution-sync”
Check “Enabled”
Service Name=Servi



This post first appeared on Albin's, please read the originial post: here

Share the post

Sling Content Distribution in AEM (Part 3) — Sync Distribution | Sync Content between Publishers in AEM as a Cloud Service

×

Subscribe to Albin's

Get updates delivered right to your inbox!

Thank you for your subscription

×