{"id":57141,"date":"2023-04-21T13:10:42","date_gmt":"2023-04-21T07:40:42","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=57141"},"modified":"2024-06-10T15:39:00","modified_gmt":"2024-06-10T10:09:00","slug":"aem-replication-queue-monitoring-using-aws-cloudwatch","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/aem-replication-queue-monitoring-using-aws-cloudwatch\/","title":{"rendered":"AEM Replication queue monitoring using AWS CloudWatch"},"content":{"rendered":"<h3><span style=\"font-weight: 400;\">This post will explain the approach to monitor the Replication Queues of Adobe Experience Manager (AEM) using AWS CloudWatch logs.<\/span><\/h3>\n<p><b>Issue:<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The AEM content replication appears to be blocked.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Editors can create content, but the activated pages on the CQ5 publish instance are not updated.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Replication issues will occur with the following scenarios:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The publisher instance is not accessible<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Author to Publisher connectivity is missing<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Bulk activation of pages or DAM assets<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Authentication and authorization issue due to credentials mismatch.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">DNS misconfigurations in the Transport section.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Transport users not having to write permission for the replicated content on the target instance<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Conflicts when writing content to the oak repository (MongoDB repository)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Network issues<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">In case there isn\u2019t any monitoring in place, usually, the customer notifies the AEM Support team whenever there is an activation issue or the activated contents are not updated in the publisher instance. We recommend ensuring that replication queue monitoring is enabled because Ops Team\/Support team will be notified if a page or DAM asset becomes stuck in the replication queue.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this blog, we will explain one of the methods for monitoring the replication queue &#8211;\u00a0 CloudWatch logs. Using this monitoring method, the appropriate team will be notified if there are any issues in the replication queue.\u00a0<\/span><\/p>\n<p><strong>Here are the 5 steps to implement the replication Queue Monitoring using Cloudwatch:<\/strong><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a replication logger in the AEM instance.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Install and Configure the Cloudwatch logger in the AEM instance.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create an SNS Topic.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Setup the Cloudwatch replication logger.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Configure Notification details in the AWS SNS.\u00a0<\/span><\/li>\n<\/ol>\n<h4><b>Step:1\u00a0 Create a replication logger in the AEM instance<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Navigate to OSGI console -&gt; Configuration tab<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Search logger for Apache Sling Logging Logger Configuration.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Name of the Log file: replication.log<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Message pattern: same<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Logger: <\/span><span style=\"font-weight: 400;\">com.day.cq.replication<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Save the configuration.<\/span><\/li>\n<\/ol>\n<h4><b>Step:2\u00a0 <\/b><b>Install and Configure Cloudwatch logger in AEM instance<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">1. Login to the AEM author instance for which we want to set up cloudWatch monitoring.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2. Run the following commands:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo yum install awslogs<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">3. Configure the awslogs.conf file to pass the logs to cloudwatch:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">vim \/etc\/awslogs\/awslogs.conf<\/span>\r\n\r\n<span style=\"font-weight: 400;\">[\/mnt\/aem\/author\/crx-quickstart\/logs\/replication.log]<\/span>\r\n\r\n<span style=\"font-weight: 400;\">datetime_format = %b %d %H:%M:%S<\/span>\r\n\r\n<span style=\"font-weight: 400;\">file = \/mnt\/aem\/author\/crx-quickstart\/logs\/replication.log<\/span>\r\n\r\n<span style=\"font-weight: 400;\">buffer_duration = 5000<\/span>\r\n\r\n<span style=\"font-weight: 400;\">log_stream_name = {instance_id}<\/span>\r\n\r\n<span style=\"font-weight: 400;\">initial_position = start_of_file<\/span>\r\n\r\n<span style=\"font-weight: 400;\">log_group_name = Replication-log<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">4. Start and enable <\/span><i><span style=\"font-weight: 400;\">awslogsd <\/span><\/i><span style=\"font-weight: 400;\">service by typing the command:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sudo service awslogsd start<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sudo systemctl\u00a0 enable awslogsd<\/span>\r\n\r\n\r\n<\/pre>\n<p><b>Step 3: Create an SNS Topic<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Login to AWS Console<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Search for SNS service<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate to SNS &gt; Topic &gt; Create Topic.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the Standard option and then Give your Topic name<\/span><\/li>\n<\/ol>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now leave the rest of the options blank (Fill if required)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create the Topic<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now we can add Subscriptions (Subjects whom we want to notify)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate to SNS &gt; Subscriptions &gt; Create Subscription<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now Create Subscription\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select a Topic (Which we created earlier)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select Protocol (Email in our case)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select Endpoint (Email address in our case)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Leave the rest of the options blank (fill in if necessary)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a subscription.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can add multiple subscriptions to a single topic. <\/span><\/li>\n<\/ul>\n<p><b>Step: 4: <\/b><b>Setup the Cloudwatch replication logger<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Specify metric and conditions<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate\u00a0 to Cloudwatch service -&gt; log groups &gt; log streams &gt; metric filters<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create metric filter<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Set the filter as \u201c<\/span><b>Failed<\/b><span style=\"font-weight: 400;\">\u201d (if any Failed entry comes in the newly created replication log &#8211; SNS will trigger an alert)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If we can keep the filter pattern as \u201c<\/span><b>401<\/b><span style=\"font-weight: 400;\">\u201d &#8211; we will be notified if there is any unauthorized error in the replication log.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select your log stream.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Test the pattern<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click on next<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Give the metric name<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select Metric Namespace<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Give Metric Value (1 in our case)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Leave the rest and click on next.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Review and create and Metric<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the metric filter (checkbox in top-right corner) and click on \u201ccreate the alarm<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the Metric name<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the Statistics as \u201cSample Count\u201d<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select Period accordingly (default : 5)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select Threshold type \u201cStatic\u201d\u2019<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now select the condition Whenever &lt;Metric Name&gt; is \u201cGreater\/Equal\u201d\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Than : &lt;your value&gt;<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Select the additional configuration accordingly (Actions on Insufficient data)and the number of data points to alarm.<\/span><\/p>\n<p><b>Step 5: <\/b><b>Configure Notification details in the AWS SNS<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate to AWS SNS Service<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Define the alarm state trigger in the AWS SNS.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">IN ALARM &gt; Select SNS Topic\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Either select an existing topic Or create a topic<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create another alarm for recovery alert when the replication queue is cleared.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Add name and description\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Preview and create Alarm.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Add the following commands to your \/.bashrc file to automatically reload the cloudwatch log; otherwise, on restarting the AEM instance, awslog will stop updating:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo echo \"Starting awslogsd\"<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo service awslogsd restart<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo systemctl enable awslogsd<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo systemctl status awslogsd<\/span><\/pre>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>This post will explain the approach to monitor the Replication Queues of Adobe Experience Manager (AEM) using AWS CloudWatch logs. Issue: The AEM content replication appears to be blocked. Editors can create content, but the activated pages on the CQ5 publish instance are not updated. Replication issues will occur with the following scenarios: The publisher [&hellip;]<\/p>\n","protected":false},"author":1545,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":108},"categories":[5868,4682],"tags":[3573,5136,4847,5192],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/57141"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1545"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=57141"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/57141\/revisions"}],"predecessor-version":[{"id":57286,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/57141\/revisions\/57286"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=57141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=57141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=57141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}