{"id":54875,"date":"2022-04-19T17:17:14","date_gmt":"2022-04-19T11:47:14","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=54875"},"modified":"2024-06-10T15:40:38","modified_gmt":"2024-06-10T10:10:38","slug":"scaling-aem-using-aws-s3-with-tar-mk","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/scaling-aem-using-aws-s3-with-tar-mk\/","title":{"rendered":"Scaling AEM using AWS-S3 with TAR-MK"},"content":{"rendered":"<h2><span style=\"font-weight: 400;\">Prerequisites\u00a0<\/span><\/h2>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AEM 6.5<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Latest Service pack (I am using 6.5.8 here).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">S3 connector (Feature pack version 1.10.10)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Amazon S3 bucket. <\/span><\/li>\n<\/ol>\n<h2><span style=\"font-weight: 400;\">Required feature pack\u00a0<\/span><\/h2>\n<p><b><i>com.adobe.granite.oak.s3connector-1.10.10.zip<\/i><\/b><\/p>\n<p><span style=\"font-weight: 400;\">Note :S3 connector feature pack has dependency over the service packs, as it uses oak as dependencies and AEM should be updated with a equal\/higher version of oak than the one s3 connector is using , look for the service packs POM to know which version of OAK is being used.<\/span><\/p>\n<blockquote><p><span style=\"font-weight: 400;\">&lt;oak.version&gt;1.22.2&lt;\/oak.version&gt;<\/span><\/p><\/blockquote>\n<h2><span style=\"font-weight: 400;\">Run modes<\/span><b>\u00a0<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">AEM needs to be started using<\/span> <b><i>crx3tar-nofds<\/i><\/b> <span style=\"font-weight: 400;\">run mode if S3 Data store to be configured with TarMK.<\/span><\/p>\n<blockquote><p><span style=\"font-weight: 400;\">java -jar <\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">aem-jar-file<\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">.jar -r crx3tar-nofds<\/span><\/p><\/blockquote>\n<h2><span style=\"font-weight: 400;\">AEM has two stores\u00a0<\/span><\/h2>\n<ol>\n<li>\n<h3><b>Node Store<br \/>\n<\/b><\/h3>\n<h3><span style=\"font-weight: 400;\">Content nodes are stored in a node store.<\/span><\/h3>\n<p><i><span style=\"font-weight: 400;\">Segment Node Store for TarMK and Document Node Store for MongoMK<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">The segment node store is the basis of Adobe\u2019s TarMK implementation in AEM6.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">PID : <\/span><span style=\"font-weight: 400;\">org.apache.jackrabbit.oak.segment.SegmentNodeStoreService<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Segment Node Configuration Options<\/span><\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Options\u00a0<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<td><b>Default value<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">repository.home<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Path to repository home under which repository-related data is stored.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">crx-quickstart\/segmentstore<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">tarmk.size<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Maximum size of a segment in MB<\/span><\/td>\n<td><span style=\"font-weight: 400;\">256 MB<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">customBlobStore<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Boolean value indicating that a custom data store is used.<\/span><\/td>\n<td><b>True<\/b><span style=\"font-weight: 400;\"> for AEM 6.3 and later versions<\/span><\/p>\n<p><b>False<\/b><span style=\"font-weight: 400;\"> for Prior to AEM 6.3<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3><b>\u00a0<\/b><\/h3>\n<\/li>\n<li>\n<h3><b>Data Store<\/b><\/h3>\n<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">The binary data is stored in a data store.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Data Store Configuration : Amazon S3 Data Store<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">PID : org.apache.jackrabbit.oak.plugins.blob.datastore.S3DataStore.config<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Steps to configure Amazon S3 as Data store &#8211;<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Extract the contents of the feature pack zip file to a temporary folder.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Go to the temporary folder and navigate to the following location: <\/span><span style=\"font-weight: 400;\">jcr_root\/libs\/system\/install<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Copy all the contents from the above location to <\/span><span style=\"font-weight: 400;\">&lt;aem-install&gt;\/crx-quickstart\/install<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">copy <\/span><b>org.apache.jackrabbit.oak.plugins.blob.datastore.S3DataStore.config <\/b><span style=\"font-weight: 400;\">file from the following folder:<\/span><\/li>\n<\/ol>\n<blockquote><p><span style=\"font-weight: 400;\">&lt;feature pack&gt;\/jcr_root\/libs\/system\/config<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">to\u00a0<\/span><\/p>\n<blockquote><p><span style=\"font-weight: 400;\">&lt;aem-install&gt;\/crx-quickstart\/install<\/span><\/p><\/blockquote>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Edit the file and add the configuration options required by your setup.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Start AEM.<\/span><\/li>\n<\/ol>\n<h4><span style=\"font-weight: 400;\">AWS S3 connector configuration options<\/span><\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>Options<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<td><b>Default value<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">accessKey<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The AWS access key<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">secretKey<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The AWS secret access key. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Note: Alternatively, IAM roles can be used for authentication. If you are using IAM roles you no longer need to specify the accessKey and secretKey.<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">s3Bucket<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The bucket name.<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">s3Region<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The bucket region.<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">path<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The path of the data store.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">&lt;AEM install folder&gt;\/repository\/datastore<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">minRecordLength<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The minimum size of an object that should be stored in the data store.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">16KB<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">maxCachedBinarySize<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Binaries with size less than or equal to this size will be stored in the memory cache. The size is in bytes.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">17408<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">cacheSize<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The size of the cache. The value is specified in bytes.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">64GB<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">secret<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Only to be used if using binaryless replication for shared datastore setup.<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">stagingSplitPercentage<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The percentage of cache size configured to be used for staging asynchronous uploads.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">uploadThreads<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The number of upload threads that are used for asynchronous uploads.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">stagingPurgeInterval<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The interval in seconds for purging finished uploads from the staging cache.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">300 seconds<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">stagingRetryInterval<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The retry interval in seconds for failed uploads.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">600 seconds<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>Observation<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">All the binaries will be stored under S3, except the one has smaller size than <\/span><b>minRecordLength<\/b><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-54874\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/04\/aem-s3-2.jpg\" alt=\"\" width=\"963\" height=\"197\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/04\/aem-s3-2.jpg 963w, \/blog\/wp-ttn-blog\/uploads\/2022\/04\/aem-s3-2-300x61.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/04\/aem-s3-2-768x157.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/04\/aem-s3-2-624x128.jpg 624w\" sizes=\"(max-width: 963px) 100vw, 963px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><b>Reference\u00a0<\/b><\/h3>\n<ul>\n<li>https:\/\/experienceleague.adobe.com\/docs\/experience-manager-65\/deploying\/deploying\/data-store-config.html?lang=en<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Prerequisites\u00a0 AEM 6.5 Latest Service pack (I am using 6.5.8 here). S3 connector (Feature pack version 1.10.10) Amazon S3 bucket. Required feature pack\u00a0 com.adobe.granite.oak.s3connector-1.10.10.zip Note :S3 connector feature pack has dependency over the service packs, as it uses oak as dependencies and AEM should be updated with a equal\/higher version of oak than the one [&hellip;]<\/p>\n","protected":false},"author":1212,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":111},"categories":[5868,1174],"tags":[4847,1332],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/54875"}],"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\/1212"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=54875"}],"version-history":[{"count":3,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/54875\/revisions"}],"predecessor-version":[{"id":54925,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/54875\/revisions\/54925"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=54875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=54875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=54875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}