<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhimanyu Gupta on Medium]]></title>
        <description><![CDATA[Stories by Abhimanyu Gupta on Medium]]></description>
        <link>https://medium.com/@abhigupta07?source=rss-54d5698663f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uWopf8gylQYsgGQN</url>
            <title>Stories by Abhimanyu Gupta on Medium</title>
            <link>https://medium.com/@abhigupta07?source=rss-54d5698663f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:34:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhigupta07/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Herding the Elephants]]></title>
            <link>https://medium.com/expedia-group-tech/herding-the-elephants-3501cb64eb3?source=rss-54d5698663f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3501cb64eb3</guid>
            <category><![CDATA[distributed]]></category>
            <category><![CDATA[aws-emr]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Abhimanyu Gupta]]></dc:creator>
            <pubDate>Tue, 12 Sep 2023 11:01:38 GMT</pubDate>
            <atom:updated>2023-09-12T11:01:38.529Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/expedia-group-tech/data/home">Expedia Group Technology — Data</a></h4><h4>Managing Hadoop clusters for petabyte scale distributed data processing</h4><figure><img alt="A woman takes a picture of an elephant in the distance from a car" src="https://cdn-images-1.medium.com/max/1024/0*KMJMiKMUZxl9GaHE" /><figcaption>Photo by Wade Lambert on Unsplash</figcaption></figure><p><strong>Team:</strong> <a href="https://www.linkedin.com/in/abhimanyugupta07/">Abhimanyu Gupta</a>, <a href="https://www.linkedin.com/in/andreea-paduraru/">Andreea Paduraru</a>, <a href="https://www.linkedin.com/in/jay-greeeen/">Jay Green-Stevens</a>, <a href="https://www.linkedin.com/in/patduin/">Patrick Duin</a>, <a href="https://www.linkedin.com/in/jmnunezizu/">Jose Nuñez-Izu</a></p><p><em>Note: Please don’t herd any actual elephants!</em></p><p>We, the <a href="https://www.expediagroup.com/">Expedia Group</a>™️ Data Lake Team, are responsible for running and maintaining the Expedia Group’s data lake. The data lake has multiple components responsible for handling data federation, replication, access controls, metadata, orphaned data deletion and more.</p><p>One of the core components of the data platform is Cloverleaf. Cloverleaf is our internal, Hive-based, data reformatting and repartitioning tool. It reads data from source Hive table partitions, merges them with the existing partitions from a target Hive table, converts the merged data to Parquet format, and finally writes it back into the partition structure requested by the customer. Cloverleaf executes Hive jobs on a fleet of auto-scaling <a href="https://aws.amazon.com/emr/">Amazon EMR</a> clusters.</p><p>Cloverleaf runs more than <strong>12,000 jobs</strong> every day, processing <strong>3.5 PB</strong> data every month. Along with the data lake, Cloverleaf has seen rapid adoption over the past 4 years. We have scaled it from processing 10 tables back in November 2019 to now <strong>1,300+ tables</strong> and growing. Suffice to say, managing this Cloverleaf data processing platform is a full-time job — many full-time jobs, in fact!</p><p>When Cloverleaf got its first few customers as a data platform tool, all the jobs used to run on a single EMR cluster with self-managed scaling rules. As Cloverleaf got more adoption, we started hitting scalability issues. Those were:</p><ul><li>YARN resource manager instability because of heavy load.</li><li>YARN resource manager instability used to cause running jobs to become orphans.</li><li>Resource contention on the cluster.</li><li>Limitations with how many jobs could run in parallel on a single large EMR cluster. For instance, only 20 Java applications could run in parallel on the master node using the <a href="https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/what-is-datapipeline.html">now deprecated Data pipeline/Taskrunner architecture</a>.</li><li>Repeated HDFS corruption.</li><li>Large jobs used to take forever to finish because of recurrent container failures.</li><li>And, in the worst case, the cluster gets terminated because it was so overloaded that it could not communicate with the EMR service.</li></ul><p>We worked through these issues by making several optimisations on the Hadoop/EMR side as well as on the application architecture side. Through this blog post, my intention is to share the learnings and best practices about Hadoop fleet management that we have gathered over these past few years.</p><h3>Load pattern</h3><p>For optimal results from your tuning exercise, it is important to first identify the pattern of your job workload on the Hadoop clusters. This then drives the scaling rules and the Hadoop/Hive configurations. Cloverleaf has an hourly burst load pattern. That means new partitions land in the source tables hourly, and 300+ jobs are launched to process them. These jobs generally need to finish within the hour so that the processing for the next hourly partition isn’t delayed.</p><h3>Service level agreement (SLA)</h3><p>Cloverleaf jobs run on shared EMR clusters. Data volumes for these jobs can fluctuate depending on the traffic, or when restatements are performed, or when backfills are done. Therefore, it is not possible to promise a fixed processing time for all jobs. That’s why Cloverleaf’s SLA is based on data volume as follows:</p><figure><img alt="A table defining the maximum expected processing time, in minutes, for a job based on its size, in GB, with additional comments stating the percentage of jobs falling into each category." src="https://cdn-images-1.medium.com/max/1024/1*dsE3OSfANjek_eJmBG47yw.png" /></figure><h3>Job distribution</h3><p>Because of the burst load pattern, the small and the large jobs all need to run at the same time. When we started, all jobs used to run on a single EMR cluster. We observed that, because of the way the default YARN scheduling algorithm works, the large jobs will take up almost all the resources on the cluster while the small jobs were waiting for a long time before they could even start. Also, there are certain high-priority large tables that need data to be processed as soon as possible.</p><p>To handle this load so that the large jobs don’t interfere with the small jobs and Cloverleaf meets its SLA, we divided the jobs into four categories.</p><p>1. Small jobs — producing less than 100 GB of data per run. More than 90% of jobs fall in this category.</p><p>2. Small jobs with high priority.</p><p>3. Large jobs — producing more than 100 GB of data per run.</p><p>4. Large jobs with high priority. Less than 1% of jobs fall in this category.</p><p>We refer to these categories as domains. Each domain is an independent fleet of EMR clusters that can be scaled out or in without impacting the other domains. It also helps us limit the impact when an issue happens in the production environment.</p><h3>Cluster scaling</h3><h4>Core nodes</h4><p>In an EMR cluster, you can scale either the worker nodes or the core nodes. We are using S3 for storing the final output. Therefore, we only need cluster storage for intermediate data. We observed that relying on core node scaleout for storing intermediate data always ended up in job failures for medium and large jobs. Errors such as the following were common:</p><pre>java.lang.RuntimeException: Error caching map.xml: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /tmp/hive/hadoop/f1650a56-a7a7-40dd-86e1-6e8ffcb86212/hive_2020-02-21_08-10-05_830_6655714004322293283-1/-mr-10003/43bc5ddc-08b7-4fce-8656-f5d519fbc65d/map.xml could only be replicated to 0 nodes instead of minReplication (=1). There are 30 datanode(s) running and no node(s) are excluded in this operation.<br> at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1735)<br> at org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.chooseTargetForNewBlock(FSDirWriteFileOp.java:265)<br> at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2575)</pre><p>The job produces data too quickly for the Core nodes to be added even if we set to scale out on HDFS utilisation of 50%. Too much data would also go to one of the nodes, and the nodes would get decommissioned, causing further job delays. Therefore, we have fixed the number of core nodes for different domains. We aim for our HDFS utilisation to be under 50%, even at peak load.</p><h4>Storage for intermediate data</h4><p>We started with using SSD EBS volumes for storage but soon realized that instance storage gave us much better performance and therefore, we shifted to that.</p><h4>HDFS replication factor</h4><p>All the data in our cluster is intermediate (moved to s3 when the job finishes). We played around with the `<em>dfs.replication`</em> factor but realised that setting it to a higher number just led to HDFS getting full faster and we don’t really need the backup of intermediate data. So, we have set the `<em>dfs.replication` </em>factor to 1 to reduce the replication workload for the core nodes.</p><h4>HDFS cleanup</h4><p>We have observed that when there are multiple jobs running on the cluster and it is constantly scaling up and down, Hive will leave lots of orphaned temporary data on HDFS. If not cleaned up, this will cause your core nodes to run out of disk space, impacting all jobs running on the cluster. We wrote a little cron job to clean up this data after a day, as we don’t expect any jobs to run for that long.</p><pre>hdfs dfs -rm -r -skipTrash /tmp/hive/cloverleaf/${file_path}</pre><h4>Scaling rules</h4><p>Initially, Cloverleaf EMR clusters had custom scaling rules which were primarily based on the <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_ViewingMetrics.html">container pending ratio</a>. Because of the burst load pattern, we needed the EMR clusters to scale out faster at the beginning of the hour and then scale back down quickly once the load subsided. With custom scaling rules, we observed that the scale out of the cluster to the maximum number of task nodes took at least 30 minutes. This was too slow for us because the jobs were just queued up in the resource manager till enough resources became available. Since October/November 2021, the EMR clusters have been running with <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-scaling.html">EMR-managed scaling</a>. It has improved the Cloverleaf job execution times because of faster scaleouts. The downside is the increased cost. We have observed that the managed scaling algorithm takes into account the maximum number of nodes that a cluster can scale out to as a factor in its calculations. This means that if you set the max nodes to a higher value to deal with the load spikes at certain times of the day or after an outage, the cluster will be scaling out more than necessary to handle the usual load as well. This leads to higher costs. We have been engaged with AWS EMR team to understand this behaviour better.</p><p><strong>February 2023 update: </strong>We observed the above behaviour while we were on EMR version 5.33.1. We migrated to EMR version 5.36.0 at the beginning of 2023 and since then the cluster scaling has improved and is along the expected lines.</p><h3>Cluster tuning</h3><p>For increasing the throughput on the EMR clusters and improving the stability of the resource manager, we have tuned a number of configurations for YARN, namenode and datanodes. I will talk about some of them below:</p><h4>Heap memory</h4><p>To handle intensive job load, the heapsize for YARN resource manager, node manager and proxyserver should be increased. We have set it as following:</p><pre>YARN_RESOURCEMANAGER_HEAPSIZE = 24 GB<br>YARN_NODEMANAGER_HEAPSIZE = 8 GB<br>YARN_PROXYSERVER_HEAPSIZE = 8 GB<br>HADOOP_HEAPSIZE = 6 GB (in hive-env.sh)</pre><h4>yarn.scheduler.capacity.maximum-am-resource-percent</h4><p>It directly impacts the number of concurrent active applications that can run on the cluster. We increased it to 0.4 (default 0.1). That <a href="https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">means</a> up to 40% resources on the cluster can be used to run application masters.</p><h4>yarn.resourcemanager.recovery.enabled</h4><p>Even after setting higher heap memory and putting larger instance types for the master node on the EMR cluster, there will be situations where the resource manager (RM) will just get overwhelmed, and it is restarted by the EMR health check. When that happens, all the running jobs lose their state, causing them to get stuck. By setting this configuration to true, the resource manager periodically saves its state on HDFS and can restore it after a restart. This has substantially improved the resiliency of Cloverleaf jobs and reduced our platform recovery time after RM failures. When RM recovery is enabled, it is highly recommended to set the following properties to improve RM performance:</p><pre>yarn.resourcemanager.fs.state-store.num-retries=2<br>yarn.resourcemanager.fail-fast=true</pre><h4>yarn.resourcemanager.system-metrics-publisher.timeline-server-v1.enable-batch</h4><p>Cloverleaf EMR clusters are long-running. After a while, we saw that RM was running into a deadlock. We found that a number of threads were waiting to communicate with the timeline server. Enabling this option, therefore, improves RM system metrics publisher’s performance by pushing events to the timeline server in batch.</p><h4>HDFS site configurations</h4><pre>dfs.namenode.handler.count=2048<br>dfs.namenode.replication.work.multiplier.per.iteration=128<br>dfs.datanode.balance.bandwidthPerSec=5368709120<br>dfs.datanode.max.transfer.threads=8192<br>dfs.datanode.handler.count=2048</pre><h3>Hive query tuning</h3><p>Just like the cluster, jobs should also be tuned to improve throughput on the clusters. Cloverleaf primarily uses tez and mr as execution engines. While tez is the default execution engine, mr is used only as a last resort once all configuration tweaks have been exhausted. We have found many Hive settings over the years to improve job performance on shared EMR clusters. I will briefly talk about some of them below.</p><h4>Compress intermediate data</h4><p>Compressing intermediate data reduces the data volume on the cluster by around 50% and makes the jobs around 30–40% faster.</p><pre>hive.exec.compress.intermediate=true</pre><h4>Delay start of reducers</h4><p>By default, YARN will start the reducers once 5% of the mappers have finished. In most of the large jobs, it takes a while before the rest of the mappers finish but reducers are already started, and they keep waiting. These containers are better utilised for other smaller jobs. Therefore, we have increased it to 0.99 and see improved cluster utilisation.</p><pre>mapreduce.job.reduce.slowstart.completedmaps=0.99</pre><h4>Retrying S3 requests</h4><p>While running thousands of jobs, you might sometimes get <a href="https://aws.amazon.com/premiumsupport/knowledge-center/emr-s3-503-slow-down/">throttling errors</a>:</p><pre>AmazonS3Exception: Slow Down (Service: Amazon S3; Status Code: 503; Error Code: 503 Slow Down;</pre><p>To handle this, we increased the S3 retries to 20 (from default 15).</p><pre>fs.s3.maxRetries=20</pre><h4>Container size</h4><p>Container size has a direct impact on how many jobs can fit onto an EMR cluster. The smaller the container size, the more jobs can be fitted. Cloverleaf jobs have a default container size of 4 GB, which works for most small- and medium-sized jobs.</p><p>For most of the large jobs, this has been overridden to 8 GB or even 12 GB.</p><h4>Default Hive job settings</h4><p>Following are the default settings that we have set after our tuning exercise. Please note that we override these settings for different datasets based on the data volumes when necessary.</p><pre>fs.s3.maxRetries: &#39;20&#39;<br>hive.execution.engine: tez<br>mapreduce.map.java.opts: &#39;-Xmx3687m&#39;<br>mapreduce.map.memory.mb: &#39;4608&#39;<br>mapreduce.reduce.java.opts: &#39;-Xmx7374m -XX:NewRatio=4&#39;<br>mapreduce.reduce.memory.mb: &#39;9216&#39;<br>tez.am.resource.memory.mb: &#39;2048&#39;<br>hive.tez.java.opts: &#39;-Xmx3278m -XX:NewRatio=4&#39;<br>hive.tez.container.size: &#39;4096&#39;<br>mapreduce.job.reduce.slowstart.completedmaps: &#39;0.99&#39;<br>hive.optimize.sort.dynamic.partition: false<br>hive.blobstore.optimizations.enabled: false<br>hive.map.aggr: false<br>hive.exec.compress.intermediate: true</pre><h3>Conclusion</h3><p>Tuning a data processing platform is tricky, especially when it also involves a Hadoop cluster. As Cloverleaf adoption increased and our scale of operation increased, the issues that we faced grew in complexity. Optimizing the cluster performance and jobs should be treated as an ongoing process rather than a one-time effort. That’s why some of these configurations are quite fluid and have changed many times in nearly four years as our understanding of Hadoop / Hive got better.</p><p>With these optimisations over the years, the platform currently supports:</p><ol><li>10,000+ jobs per day.</li><li>Processes data volume of 3.5 Petabyte per month.</li><li>1300+ tables are onboarded.</li><li>A fleet of 8 EMR clusters with a combined max capacity of 2000+ nodes.</li><li>Recently, upgrading the EMR version to 5.36.0has provided us with much better scaling performance and consequently ~30% cost savings.</li></ol><p>I want to especially thank my teammate, <a href="https://medium.com/u/9cb9098eedca">Patrick Duin</a>, who has been my partner on this voyage. I hope this post will provide some useful tips on how to scale a data processing platform. Please let us know in the comments if you tried some new optimisation ideas. We would love to hear from you!</p><blockquote><a href="https://careers.expediagroup.com/life/">Learn more about life at Expedia Group</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3501cb64eb3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/expedia-group-tech/herding-the-elephants-3501cb64eb3">Herding the Elephants</a> was originally published in <a href="https://medium.com/expedia-group-tech">Expedia Group Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drone Fly — Decoupling Event Listeners from the Hive Metastore]]></title>
            <link>https://medium.com/expedia-group-tech/drone-fly-decoupling-event-listeners-from-the-hive-metastore-43b0107b15e2?source=rss-54d5698663f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/43b0107b15e2</guid>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[hive]]></category>
            <dc:creator><![CDATA[Abhimanyu Gupta]]></dc:creator>
            <pubDate>Tue, 29 Sep 2020 13:02:19 GMT</pubDate>
            <atom:updated>2021-04-19T08:56:08.101Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/expedia-group-tech/data/home">EXPEDIA GROUP TECHNOLOGY — DATA</a></h4><h3>Drone Fly — Decoupling Event Listeners from the Hive Metastore</h3><h4>Deploy Hive metastore listeners outside Hive’s context to improve metastore reliability</h4><figure><img alt="Logo of Drone Fly where a bee with an elephant face wrapped in letter D is sending packets to a drone fly on top of letter Y." src="https://cdn-images-1.medium.com/max/1024/1*F5fI52pySFv7mXHaNeLnDg.png" /><figcaption><a href="https://github.com/ExpediaGroup/drone-fly">Drone-Fly</a> Logo</figcaption></figure><p>We, the Expedia Groupᵀᴹ<em> </em>Data Platform Team, are building the next-gen petabyte-scale data lake. This next stage in the evolution of our data lake is based on our <a href="https://github.com/ExpediaGroup/apiary">Apiary data lake</a> pattern and utilizes a number of our open-source components like <a href="https://github.com/HotelsDotCom/waggle-dance">Waggle-Dance</a>, <a href="https://github.com/HotelsDotCom/circus-train">Circus-Train</a>, etc. A Hive metastore (HMS) proxied by the Waggle Dance service is usually the first point of contact for a user query to discover and analyze data. That makes the Hive metastore a critical piece of infrastructure.</p><p>We utilize a number of Hive metastore listeners that are installed in the Hive metastore to enable a variety of event-based use cases such as <a href="https://github.com/ExpediaGroup/shunting-yard/">Shunting Yard</a>, <a href="https://medium.com/expedia-group-tech/can-hive-union-distinct-really-cause-data-loss-6d96cec2128b">Cloverleaf</a>, <a href="https://github.com/ExpediaGroup/beekeeper">Beekeeper</a>, Ranger policies etc. Some of the open-source listeners that we use are:</p><ul><li><a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/apiary-metastore-events/sns-metastore-events/apiary-metastore-listener">Apiary-SNS-Listener</a> — pushes Hive metastore events as JSON onto an <a href="https://aws.amazon.com/sns/">AWS SNS</a> topic.</li><li><a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/apiary-metastore-events/kafka-metastore-events/kafka-metastore-listener">Apiary-Kafka-Listener</a> — pushes Hive metastore events to <a href="https://kafka.apache.org/">Apache Kafka</a>.</li><li><a href="https://github.com/apache/atlas/blob/master/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveMetastoreHookImpl.java">Atlas Listener</a> — pushes Hive metastore events to <a href="http://atlas.apache.org/">Apache Atlas</a>.</li><li><a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/hive-event-listeners/apiary-gluesync-listener">Apiary-GlueSync-Listener</a> — pushes metadata updates to an <a href="https://aws.amazon.com/glue">AWS Glue catalog</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r_Po2XFXodQTxKUU.png" /></figure><h4>The Problem</h4><p>Over the last couple of years, we received an increasing number of requests to enable more and more event-driven use-cases. These require us to install and maintain a growing list of HMS listeners in the Hive metastore. Some of these listeners are provided to us by third parties to enable HMS integration with their tools. These perform operations like sending events to external messages buses, connecting with databases, calling third-party APIs etc. More and more processing is added to these listeners to address various business use cases.</p><p>Given the critical nature of the Hive metastore in our data lakes, this tight coupling is problematic:</p><ul><li>As more listeners are installed, the metastore will increasingly spend more time notifying each listener as it is done <a href="https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreListenerNotifier.java#L285">sequentially</a>. This could cause unnecessary load on your metastore or in the worst case, it could take down the entire metastore (e.g. by running out of memory, thread starvation etc.)</li><li>If there is a bug in one of the installed listeners, it will impact the metastore and other listeners might not be notified because of the <a href="https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreListenerNotifier.java#L285">sequential nature</a> of the notification logic.</li><li>When installing a new listener, we need to make changes in the <a href="https://github.com/ExpediaGroup/apiary-metastore-docker/blob/master/Dockerfile#L37">metastore docker image</a> and the container deployment requires downtime.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhN3ms7By0S8-hgY8S5Skw.png" /></figure><h4><strong>Introducing Drone Fly</strong></h4><p>To address the above issues and to make the onboarding process for a new listener robust, we developed a service called <a href="https://github.com/ExpediaGroup/drone-fly">Drone Fly</a>.</p><p>Drone Fly is a distributed Hive metastore events forwarder service that allows users to deploy metastore listeners outside the Hive metastore service. With Drone Fly, you need to install just one listener in your metastore. i.e. the open-source <a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/apiary-metastore-events/kafka-metastore-events/kafka-metastore-listener">Apiary-Kafka-Listener</a>. You can then install one or more of your listeners in Drone Fly’s virtual Hive context by providing them on Drone Fly’s classpath.</p><p><strong>Trivia: </strong>We named it Drone Fly because it mimics the Hive metastore context just like in nature, a <a href="https://www.wildlifetrusts.org/wildlife-explorer/invertebrates/flies/drone-fly">Drone Fly mimics a Honey Bee</a> :)</p><p>Let us see how your event-driven data lake architecture changes with Drone Fly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JzUIfkVJXS-S3Q1N.png" /></figure><h4><strong>Architecture without Drone Fly</strong></h4><p>The diagram below shows a typical Hive metastore setup without using Drone Fly. In this example, there are several HiveMetastoreListenersinstalled which send Hive events to other systems like Apache Atlas, AWS SNS, Apache Kafka and other custom implementations.</p><figure><img alt="A block diagram showing listeners deployed in Hive Metastore and sending events to Apache Atlas, AWS SNS, Kafka etc." src="https://cdn-images-1.medium.com/max/1024/1*wlewLmW4wFUnmCLFvTXaEA.png" /><figcaption>Architecture without Drone Fly</figcaption></figure><h4>Architecture with Drone Fly</h4><p>With Drone Fly, the setup is modified as shown in the diagram below. The only listener installed in the Hive metastore context is the <a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/apiary-metastore-events/kafka-metastore-events/kafka-metastore-listener">Apiary Kafka Listener</a>. This forwards Hive metastore events on to Kafka from which Drone Fly can retrieve them. The other listeners are moved out into separate contexts and receive messages from Drone Fly which forwards them on as if they were Hive metastore events so the listener code doesn’t need to change at all.</p><figure><img alt="Block diagram showing listeners deployed within Drone Fly context and forwarding events to Apache Atlas, AWS SNS etc." src="https://cdn-images-1.medium.com/max/1024/1*cqhSC3JLRgSXmkpUwll12A.png" /><figcaption>Architecture with Drone Fly</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhN3ms7By0S8-hgY8S5Skw.png" /></figure><h4>Deploying Drone Fly</h4><p>Deploying Drone Fly is straightforward. You can run it as a standalone Java service or as a Docker container on Kubernetes using the <a href="https://hub.docker.com/r/expediagroup/drone-fly-app">Drone Fly base image</a>. You will also need to install the <a href="https://github.com/ExpediaGroup/apiary-extensions/tree/master/apiary-metastore-events/kafka-metastore-events/kafka-metastore-listener">Apiary Kafka Listener</a> in the Hive metastore so that Drone Fly<em> </em>can consume metastore events emitted from it. Please refer to the <a href="https://github.com/ExpediaGroup/drone-fly/blob/master/README.md">documentation</a> for detailed installation steps.</p><p>We have also open-sourced an <a href="https://github.com/ExpediaGroup/apiary-drone-fly">apiary-drone-fly</a> Terraform module to simplify installation. This repository contains all the Terraform scripts needed to spin up Drone Fly on Kubernetes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uB5TBSnXxCY7Zc2pHpttjA.png" /></figure><h4><strong>Conclusion</strong></h4><p>With Drone Fly, your Hive metastore is completely decoupled from your listeners. To achieve even further decoupling, Drone Fly can be set up to run in dockerized containers where each instance is initiated with one listener. This way, even if one of your listeners goes down, other listeners can continue to function without interruption. We follow this pattern for our Expedia Group data lake and it provides us with the flexibility to deploy multiple listeners without having to worry about metastore performance. It also streamlines the onboarding of new listeners to our data lake.</p><p>Please take a look at the <a href="https://github.com/ExpediaGroup/drone-fly">Drone Fly repo</a> for more info on getting started.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43b0107b15e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/expedia-group-tech/drone-fly-decoupling-event-listeners-from-the-hive-metastore-43b0107b15e2">Drone Fly — Decoupling Event Listeners from the Hive Metastore</a> was originally published in <a href="https://medium.com/expedia-group-tech">Expedia Group Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can Hive Union Distinct Really Cause Data Loss?]]></title>
            <link>https://medium.com/expedia-group-tech/can-hive-union-distinct-really-cause-data-loss-6d96cec2128b?source=rss-54d5698663f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d96cec2128b</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Abhimanyu Gupta]]></dc:creator>
            <pubDate>Fri, 24 Jul 2020 07:41:00 GMT</pubDate>
            <atom:updated>2020-07-24T07:41:00.969Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/expedia-group-tech/data/home">EXPEDIA GROUP TECHNOLOGY — DATA</a></h4><h4>Story of a 4 month long investigation into data loss issues with Hive</h4><figure><img alt="An abstract photo with a large question mark in the middle" src="https://cdn-images-1.medium.com/max/1024/1*Kewz0xLvwocuc8INzphzmA.jpeg" /><figcaption>Photo by Emily Morter on Unsplash</figcaption></figure><p>The short answer is no, but there could be other things wrong with your query! Read on to find out what they turned out to be in our case.</p><p>As software engineers, it is quite usual for us to hit bugs in our applications when we run them in a production environment. In spite of our best efforts and modern tools available for automated software testing, there are always those scenarios which happen only in prod. These bugs can be trivial or sometimes might require extensive investigation but rarely do these investigations go on for over 4 weeks.</p><p>Recently, we, the Expedia Groupᵀᴹ<em> </em>Data Platform Team, hit one such bug which took us <strong>4 months</strong> of extensive investigation to find the root cause. I decided to chronicle our journey in the hopes that our learnings (and we had lots of them) will help a tired soul some day to solve their missing data mystery. If you want to skip the buildup and go straight to the solution, skip down to our <a href="#4c3a"><strong>Eureka Moment!</strong></a></p><figure><img alt="decorative separator" src="https://cdn-images-1.medium.com/max/1024/0*uK3hwE16FgUMrknF.png" /></figure><p>In the big data world, bugs are usually a bit harder to locate given the abstract nature of the data platforms on which these applications run and the large amount of data that they process. For instance, Hive SQL queries are internally converted into map reduce jobs by Hive and then executed on a Hadoop cluster. As a developer, you just trust the underlying platforms like Hive and Hadoop to work as expected as long as your business logic is fine.</p><p>Let me introduce Cloverleaf at this point. Cloverleaf is our internal, Hive-based, data reformatting and repartitioning tool. It reads data from source Hive table partitions, merges them with the existing partitions from a target Hive table, converts the merged data to Parquet format, and finally writes it back in the partition structure requested by the user. Cloverleaf runs on a shared auto-scaling Amazon EMR cluster where we run multiple Hive jobs at a time.</p><p>So, in January this year, when a customer reported that the Hive table generated and managed by Cloverleaf lost data, our first reaction was to check all other Cloverleaf-managed tables to verify that our core logic was correct. We found that the row counts in all of our other tables matched between source and target. This meant that Cloverleaf was working as expected for all other tables.</p><p>We then discovered that the problematic table had been reprocessed a few times in the past in order to propagate schema changes. We thought something might have gone wrong with this reprocessing, so we quickly reprocessed the problematic partitions using Cloverleaf and it fixed the row counts for those partitions. We assumed that a manual reprocess had been the cause of the errors.</p><figure><img alt="decorative separator" src="https://cdn-images-1.medium.com/max/1024/0*2D4eTzUXayWfYPqU.png" /></figure><h4>Double partition Issue</h4><p>Meanwhile, users were reporting another weird data corruption issue in their Hive tables that looked something like this:</p><pre>Error opening Hive split s3://&lt;TABLE_BASE_PATH&gt;/&lt;UNIQUE_SNAPSHOT_ID&gt;/local_date=2019–12–03<strong>/brand=expedia/brand=expedia_$folder$</strong> (offset=0, length=0):</pre><pre>s3://&lt;TABLE_BASE_PATH&gt;/&lt;UNIQUE_SNAPSHOT_ID&gt;/local_date=2019–12–03<strong>/brand=expedia/brand=expedia_$folder$</strong> is not a valid Parquet File</pre><p>Notice the text in bold above. This table is partitioned on local_date and brand but Hive on EMR created this <strong>double partition folder along with _$folder$ file </strong>in that partition on S3. This was happening in an unpredictable manner in random output partitions. The actual data for that partition was being stored in the lowest leaf folder.</p><p>On further inspection, we found that this was also happening in other tables. We looked in the Hive metastore logs, AWS S3 access logs and also involved AWS premium support but because it was difficult to reproduce, we could not find the root cause.</p><h4>And then the data loss issue was back!</h4><p>After a couple of weeks, the data loss issue described above was reported again in the same table. This time we were sure that the table had not had any manual interventions and that something was really wrong. Note that there were still other tables that were just fine and there was no data loss occurring for those. This triggered our investigation.</p><h3>Sleuthing starts!</h3><figure><img alt="Photo of a hunting dog in a wooded landscape" src="https://cdn-images-1.medium.com/max/1024/1*G1q-wezREYZah8ov_q9S_w.jpeg" /><figcaption>Photo by Kevin Noble on Unsplash</figcaption></figure><h4>Fix double partition issue</h4><p>At first, we tried to find some correlation between the two issues that we had. We found a few partitions which were impacted by the double partition issue and had data loss. Given that we didn’t know the root cause behind the double-partition issue, we added a feature to Cloverleaf to fix the partition by moving data one level up and deleting the extra level <strong>brand=expedia_$folder$. </strong>At the very least, we expected this would solve one issue for us.</p><h4>Added row count validation</h4><p>We then also added a row count validation step to Cloverleaf that uses Hive’s table statistics. Cloverleaf always writes the restated data in a new S3 location to do <a href="https://en.wikipedia.org/wiki/Snapshot_isolation">snapshot isolation</a>. The validation we added would fail a particular Cloverleaf run if the row count of the restated partition was less than that of an existing partition. We hoped this would help us to identify the data loss issues right as they happened instead of having to dig around in the logs days or weeks later. Because the validation would fail the run this would also prevent the merging of new partitions with data loss in our production data sets. We’d rather have old, correct data than new, incorrect data!</p><p>The result was not what we expected. There were row count validation failures even in those tables where the overall row counts were fine.</p><h4>Fixing Hive stats</h4><p>On further investigation, we found that even after setting the Hive property:</p><pre>set hive.stats.autogather=<strong>true</strong>;</pre><p>Cloverleaf’s usage of an insert overwritequery was not producing correct statistics(numRows) for the output partitions. That meant the majority of the row count validation failures that we were seeing were false positives. We decided to put an explicit COMPUTE STATISTICS step at the end of our INSERT OVERWRITE query to set the correct stats on the output partitions.</p><pre>ANALYZE TABLE PARTITION (part_col=&#39;&lt;value&gt;&#39;) COMPUTE STATISTICS</pre><p>Once we realized that all of our existing partition statistics counts were wrong we manually updated the statistics on all of our existing tables.</p><p>With all these fixes in place, we now had to wait for the actual row count validation failures to happen again so we could debug our real issue.</p><h4>Real failures and panic</h4><p>After a few days, we saw our first “actual” row count validation failure, and then another. In the next two days validation failures were observed in all of the larger datasets that were recently onboarded. This was really alarming as we could no longer ensure data reliability for our customers. Our number one priority was correcting the data so we launched a massive team effort to reprocess the data in the affected partitions which seemed to solve the issues and give us some breathing space to continue our investigations. An additional benefit of this was that the next time a data loss issue happened, it would be on latest data and we would be able to save a copy of it to continue our investigation.</p><h4>Data is not just missing, we have duplicates too!</h4><p>Over the next few weeks, we tried all kinds of things to reproduce the issue in non-Production environments without any success and we were really running out of options. To keep the ship afloat, the reprocessing of partitions that we were doing had become a huge operational overhead for us.</p><p>Another baffling observation was that there were also duplicate rows in those partitions. <strong>So, Cloverleaf was not just missing some data but was also adding duplicate rows</strong>.</p><p>From observing the situations leading to the data loss we identified two common threads:</p><ul><li>The issue happened only in the tables that contained large amounts of data, eg. 100 GB per partition.</li><li>The issue seemed more likely to occur when the EMR cluster was running a large number of parallel jobs.</li></ul><h4>Set up a testing environment in production</h4><p>I mentioned at the beginning that there are some scenarios which only happen in production and we believed this was one such scenario. So we set up a separate EMR cluster in production to run Cloverleaf in parallel but write the output to scratch tables. This would then give us something using production data that we could experiment with, without impacting the real production data.</p><p>At its core Cloverleaf executes the following Hive query:</p><pre>INSERT OVERWRITE TABLE <br>  TEMP_TARGET_TABLE<br>PARTITION (`target_part_col_1`,`target_part_col_2`)<br>  SELECT * FROM TARGET_TABLE<br>    UNION DISTINCT<br>  SELECT * FROM SOURCE_TABLE<br>  DISTRIBUTE BY PART_COL_1, PART_COL_2, cast(round(rand()*10)   as INT);</pre><p>We took this query and wrote scripts to execute it multiple times with large numbers of source partitions and compared row counts after every run. Within hours, we started seeing the row count validation failures. <strong>This was the first time we were able to reproduce the issue.</strong> We checked the data and were able to pinpoint missing and duplicate rows. We concluded:</p><ul><li>There was nothing unusual about those rows. So, the issue wasn’t in the source data.</li><li>There were no double partitions on S3 in the output table. So, the two issues, double partition and data loss, were not connected.</li><li>There were a large number of killed reducers in the map reduce jobs that produced incorrect data. However, the jobs where the row count was correct had fewer killed reducers so it looked like the issue was being caused by high load.</li></ul><h4>The big clue</h4><figure><img alt="Multiple pairs of hands holding a treasure map" src="https://cdn-images-1.medium.com/max/1024/1*HhiUq5E6rfi6NPMB0F-hcg.jpeg" /><figcaption>Photo by N. on Unsplash</figcaption></figure><p>With the information that we had so far, we listed potential problem areas:</p><ul><li>Writing to Parquet format.</li><li>Writing data to HDFS first and then moving it to S3. We had disabled Hive’s <a href="https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-Blobstore(i.e.AmazonS3)">blob store optimization</a> flag as we were processing data on EMR’s HDFS first before moving it to S3 using distcp.</li></ul><pre>set hive.blobstore.optimizations.enabled=false</pre><ul><li>Writing data to Hive table</li><li>A bug in Hive’s “Union Distinct” clause (highly unlikely)</li></ul><p>Then we used our testing script to set up these tests individually. We found that:</p><ul><li>The issue happened even if Cloverleaf writes data in ORC format.</li><li>Changing the blob store optimization flag had no effect.</li><li>Writing data to just HDFS did not solve the issue.</li><li><strong>The issue did not happen when you don’t write the data.</strong></li></ul><p>The last point means that the Cloverleaf query was executed without the insert overwrite clause and row count validation was run as part of the query itself.</p><pre>SELECT PART_COL_1, PART_COL_2, count(*)<br>FROM<br>(SELECT * FROM TARGET_TABLE<br>    UNION DISTINCT<br>SELECT * FROM SOURCE_TABLE<br>GROUP BY PART_COL_1, PART_COL_2) x</pre><p><strong>This was a big clue! </strong>Now we knew that the issue was being caused when Hive writes data to the table.</p><h3>Eureka moment!</h3><figure><img alt="Image of children playing with a ball in a field with trees" src="https://cdn-images-1.medium.com/max/1024/1*BPiWVZ7OKGTrC8mpO9ZUCw.jpeg" /><figcaption>Photo by Robert Collins on Unsplash</figcaption></figure><p>Armed with this information, we looked back on our query.</p><pre><strong>INSERT OVERWRITE TABLE <br>  TEMP_TARGET_TABLE<br>PARTITION (`target_part_col_1`,`target_part_col_2`)</strong><br>  SELECT * FROM TARGET_TABLE<br>    UNION DISTINCT<br>  SELECT * FROM SOURCE_TABLE<br>  <strong>DISTRIBUTE BY PART_COL_1, PART_COL_2, cast(round(rand()*10)   as INT);</strong></pre><p>We knew the text in bold in the above query had our issue hidden somewhere. To <strong>control the</strong> <strong>number of output files in each partition</strong>, we had introduced the distribute by clause with cast(round(rand()*10). All it was supposed to do was to distribute rows randomly to (in this case) 10 reducers. This number 10 was generated in Cloverleaf dynamically based on data volume for a particular table.</p><p>It seemed quite straightforward but we were really clutching at straws here. So, we started to search for some alternative approaches to control file sizes and stumbled upon this <a href="https://stackoverflow.com/a/55375261/1566023">StackOverflow answer</a>. And Bingo! Once you understand how Hadoop handles restarting killed reducers, you will quickly realize that this<strong> non-determinism introduced by </strong><strong>rand() was causing all of our data loss/data duplication issues</strong>.</p><p>Let me elaborate on it a bit more. When a container, (the reducer writing the output data in this case) is restarted because it was running on a node experiencing memory or network issues, Hadoop will try and distribute the data again to a newly launched reducer and therein lies the problem. The random number generated for each row that determines which reducer will handle a particular row won’t necessarily be the same next time it gets calculated. So, a particular row that is already present in another reducer’s output might get distributed again to a new reducer (causing data duplication) or some row might not get any reducer as the designated reducer might have already finished (causing data loss).</p><p>Now, we only needed to replace the rand() function with a deterministic, evenly distributed key. That wasn’t difficult, as we could use Hive’s hash function and apply it on all columns in the data to get a fairly even distribution of data, like so:</p><pre>abs(hash(source_col_1, source_col_2, source_col_3,...))%10</pre><p>And why did the issue only happen when there was high load? Well, that’s when the nodes are more likely to run out of memory and reducers are pre-empted. We tested out these changes extensively with heavy load before rolling this out. We haven’t observed any data loss in Cloverleaf managed Hive tables since then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFEnh5nNCzSTWKXdMaaImA.png" /></figure><h3>Conclusion</h3><p>As painful as this was, it was also a good learning experience. Looking back, this bug was so difficult to locate because it was only happening in our production environment and we were constantly on-boarding new tables while debugging. We were fairly new to the auto-scaling EMR cluster setup and had to spend a lot of time tuning our Hive queries and EMR configuration to get that right balance between performance and stability. As always in retrospect, creating the parallel test setup in production early on in the investigation would have made debugging a lot faster. Also, next time we see something wrong with data, we would think twice before blaming Hive for it.</p><p>I hope you enjoyed reading about our journey. It was an enlightening voyage of discovery for us. Thanks to <a href="https://medium.com/u/9cb9098eedca">Patrick Duin</a>, <a href="https://medium.com/u/4b87ad35c782">Jay Green-Stevens</a> &amp; <a href="https://medium.com/u/648a203e94dc">Max Jacobs</a>, who are part of Expedia Group’s Data Platform team and helped track down this nasty one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d96cec2128b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/expedia-group-tech/can-hive-union-distinct-really-cause-data-loss-6d96cec2128b">Can Hive Union Distinct Really Cause Data Loss?</a> was originally published in <a href="https://medium.com/expedia-group-tech">Expedia Group Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elastic Container Service — When AWS Documentation is not enough]]></title>
            <link>https://medium.com/expedia-group-tech/elastic-container-service-when-aws-documentation-is-not-enough-d1288bfb89fb?source=rss-54d5698663f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1288bfb89fb</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Abhimanyu Gupta]]></dc:creator>
            <pubDate>Thu, 04 Apr 2019 13:11:00 GMT</pubDate>
            <atom:updated>2019-08-27T12:38:07.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*xzwO7HTx-sXpaSx4ifA_ZQ.png" /></figure><h3>Elastic Container Service — When AWS Documentation is not enough</h3><h4>How to run a Hadoop Application in an ECS Cluster</h4><p>Recently, to create infrastructure for our new product, <a href="https://github.com/HotelsDotCom/shunting-yard">Shunting Yard</a>, we, the Hotels.com Big Data Platform Team, had the opportunity to work on Terraform, Docker and AWS Elastic Container Service. The task was to amalgamate these three tools to automate infrastructure creation. It turned out to be a great learning experience and I decided to write this post detailing some of the issues that we encountered and the steps which were followed to get it all running.</p><p>Before we dive deeper, let’s get an overview of the building blocks of Elastic Container Service. Amazon <a href="https://aws.amazon.com/ecs/">Elastic Container Service</a> (ECS) is a highly scalable, high-performance <a href="https://aws.amazon.com/containers/">container</a> orchestration service that supports <a href="https://aws.amazon.com/docker/">Docker</a> containers and allows you to easily run and scale containerized applications on AWS. It consists of a container instance to run the tasks on and an ECS agent to communicate with the ECS service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*Ef3bnvoz8GMbacqgzwuQ8A.png" /></figure><h4>Container Instance</h4><p>A container instance is an instance running the ECS agent, has a <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html">specifically defined</a> <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingIAM.html">IAM policy and role</a> and has been registered into your ECS cluster. It is in these instances that ECS runs the containers.</p><h4>ECS Agent</h4><p>The<a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_agent.html"> Amazon ECS container agent</a> is a Go program that runs in its own container within each EC2 instance that you use with ECS. It’s also available as an open source project on <a href="https://github.com/aws/amazon-ecs-agent">GitHub</a>.</p><h4>AMI</h4><p>These container instances can use any AMI as long as it has <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">the following specifications</a>: a modern Linux distribution with the agent and the Docker Daemon with all the Docker runtime dependencies running on it. If you like to keep it simple, you can simply use an <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html">Amazon-ECS-Optimized AMI</a> which takes care of all the necessary configurations for an ECS instance.</p><p>You can read more about these building blocks on this excellent <a href="https://aws.amazon.com/blogs/compute/building-blocks-of-amazon-ecs/">AWS blog</a>.</p><h4>Types of Instances</h4><p>ECS supports two types of instances, <strong>EC2 and Fargate</strong>.</p><p><strong>EC2:</strong> An EC2 instance type is an Amazon EC2 instance that is running the Amazon ECS container agent and has been registered with an ECS cluster.</p><p><strong>Fargate: </strong><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">AWS Fargate</a> is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances. With AWS Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers. This removes the need to choose server types or decide when to scale your clusters.</p><p>Amazon recommends using Fargate type of instances, but it has a drawback. As a Fargate container is managed by AWS, a developer doesn’t have login access to the container and hence any debugging needs to happen through the logs available on CloudWatch. This can sometimes be very time consuming, especially when you are debugging an application which needs to be deployed in a Docker image.</p><p>For this reason, we started with an EC2 instance type. Amazon has exhaustive <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/get-set-up-for-amazon-ecs.html">documentation</a> on how to setup an ECS cluster on AWS. So, in this post I am going to focus on some of the issues that I faced while setting up the ECS cluster and how I resolved those.</p><h3>Issues faced while setting up EC2 Instance Type</h3><p>As a first time user of ECS, I started from the AWS ECS console and created an ECS Cluster, a service and a task for it which was going to use my Docker image already pushed to ECR. I expected it all to work but the ECS service threw the following error when it tried to place the task on a container.</p><pre>Error: (service service-name) was unable to place a task because no container instance met all of its requirements.</pre><p>The steps below can be followed to resolve this error:</p><ol><li>First open the ECS Console and navigate to your cluster and check the registered container instances.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vHsnd1znLgk1Kx3jVk_vA.png" /></figure><p>If Registered container instances shows zero as the value, then your EC2 container instance has failed to register itself with the Elastic Container Service.</p><p>2. The above failure may be caused because the subnet of your EC2 container instance is not in the allowed subnets of your ECS service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWr7CAos4jmgQYiVS8CAGA.jpeg" /></figure><p>3. Then, check that the security group of both your ECS Service and EC2 container instance allows communications between them. This is necessary because the container agent running on your EC2 container instance needs to communicate with the ECS service to register the instance as well as to send telemetry data about the tasks and resource utilization of that instance to the Amazon ECS service.</p><p>4. If none of the above solves your issue, it’s time to login to your EC2 container instance and test if the agent is running or not. To do this, follow the <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-introspection.html">container agent introspection</a> steps.</p><p>5. Additionally, you can also put the following shell script code snippet in your EC2 bootstrap User Data section to force your container agent to communicate with your ECS cluster:</p><pre>#!/bin/bash<br>echo ECS_CLUSTER=&quot;&lt;ecs-cluster-name&gt;&quot; &gt;&gt; /etc/ecs/ecs.config</pre><p>Hopefully, after following the above steps, your EC2 container instance will register itself with the ECS service and the Registered container instances will show a non-zero value.</p><p>Once your task is placed on the EC2 container instance, you can debug your application by SSH’ing into the EC2 instance and <a href="https://docs.docker.com/engine/reference/commandline/attach/">attaching to the running docker container</a>.</p><pre>docker container ls<br>docker attach CONTAINER_ID </pre><h3>Fargate Instance Type</h3><p>Once you have your application running successfully on an EC2 container instance, you might want to consider moving to the AWS recommended <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">Fargate</a> type container instances. The move to Fargate is pretty straightforward as it can be done simply by changing the Launch Type of your ECS service.</p><h3>Issues faced while setting up FARGATE instance type</h3><p>I changed the Launch Type to Fargate and hoped that I wouldn’t need anymore changes to my application but I ran into the following issues which I describe in detail below.</p><ol><li>ECS Task throws the following error and fails to start.</li></ol><pre>com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)),<br>com.amazonaws.auth.InstanceProfileCredentialsProvider@3c43d5a1: Unable to load credentials from service endpoint</pre><p>To understand this error better, let’s briefly look at how AWS Credentials work within an ECS container.</p><h4>AWS Credentials</h4><p>To make requests to Amazon Web Services, AWS credentials need to be supplied to the AWS SDK. This can be done in the following ways:</p><ul><li>Use the <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html?com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html">default credentials provider chain</a> <em>(recommended)</em>.</li><li>Use a specific credential provider or provider chain (or create your own).</li><li>Supply the credentials yourself. These can be root account credentials, IAM credentials, or temporary credentials retrieved from <a href="https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html">AWS STS</a>.</li></ul><p>When you run your application inside a FARGATE container, the only way to get the credentials without providing them explicitly is to get them from the AWS credential service. The ECS Agent first fetches credentials for the container’s task role from the AWS credential service and sets the credentials key ID (a UUID) as the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable inside the container when it is started.</p><pre>AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = /v2/credentials/3bfeea6b-4b9e-4851-994a-d5ab8f174f22</pre><p>Using this relative URI, the application will fetch the credentials over HTTP.</p><pre>curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI</pre><pre>output:<br>{<br>  &quot;RoleArn&quot;: &quot;arn:aws:iam::111111111111:role/test-service&quot;,<br>  &quot;AccessKeyId&quot;: &quot;HOTELSIFDSNLCKFN&quot;,<br>  &quot;SecretAccessKey&quot;: &quot;REDACTED&quot;,<br>  &quot;Token&quot;: &quot;REDACTED&quot;,<br>  &quot;Expiration&quot;: &quot;2017-08-10T02:01:43Z&quot;<br>}</pre><h4>Resolution</h4><p>The SdkClientExceptiondescribed above is being thrown because the application is not configured to get the credentials from the AWS credential service. Thankfully, Amazon has provided a <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html?com/amazonaws/auth/ContainerCredentialsProvider.html">ContainerCredentialsProvider</a> for handling all of this. This provider is also part of the <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html">default credentials provider chain</a>.</p><p>However, in our situation we couldn’t use the default credentials provider chain as we needed to get the credentials from a custom credentials store and our application also needs to run outside of ECS for some of the use cases. So, if you are in a similar situation, you can add <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html?com/amazonaws/auth/EC2ContainerCredentialsProviderWrapper.html">EC2ContainerCredentialsProviderWrapper</a> to your application. This wrapper implementation will first try <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html?com/amazonaws/auth/ContainerCredentialsProvider.html">ContainerCredentialsProvider</a> and if not successful, will fallback to the <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/InstanceProfileCredentialsProvider.html">InstanceProfileCredentialsProvide</a>r that loads credentials from the Amazon EC2 Instance Metadata Service.</p><p>2. Overriding credentials used in the S3AFileSystem implementation</p><p>Our application uses the Hadoop FileSystem API to check for existence of S3 paths before writing to them. These API calls use the S3AFileSystem implementation included in <a href="https://hadoop.apache.org/docs/current/hadoop-aws/tools/hadoop-aws/index.html">Hadoop-AWS module</a>. The S3A client follows the following authentication chain:</p><ol><li>Login details are extracted from the filesystem URI.</li><li>The fs.s3a.access.key and fs.s3a.secret.key are looked for in the Hadoop XML configuration.</li><li>The <a href="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment">AWS environment variables</a> are then looked for.</li><li>An attempt is made to query the Amazon EC2 Instance Metadata Service to retrieve credentials published to EC2 VMs. (InstanceProfileCredentialsProvider)</li></ol><p>Inside a container, if none of the above methods to retrieve credentials are available, the application will throw a runtime exception similar to the one shown above.</p><h4>Resolution</h4><p>The issue can be resolved by overriding the default authentication chain and the S3A implementation provides an option to do that. The following configuration needs to be added to the core-site.xml file of the Hadoop environment being setup inside the Docker container.</p><pre>&lt;property&gt;<br>    &lt;name&gt;fs.s3a.aws.credentials.provider&lt;/name&gt;<br>    &lt;value&gt;<br>          com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper<br>    &lt;/value&gt;<br>&lt;/property&gt;</pre><p>The resulting core-site.xml will look like:</p><pre>&lt;property&gt;<br>    &lt;name&gt;fs.s3.impl&lt;/name&gt;<br>    &lt;value&gt;org.apache.hadoop.fs.s3a.S3AFileSystem&lt;/value&gt;<br>&lt;/property&gt;</pre><pre>&lt;property&gt;<br>    &lt;name&gt;fs.s3n.impl&lt;/name&gt;<br>    &lt;value&gt;org.apache.hadoop.fs.s3a.S3AFileSystem&lt;/value&gt;<br>&lt;/property&gt;</pre><pre>&lt;property&gt;<br>    &lt;name&gt;fs.s3a.impl&lt;/name&gt;<br>    &lt;value&gt;org.apache.hadoop.fs.s3a.S3AFileSystem&lt;/value&gt;<br>  &lt;/property&gt;</pre><pre>&lt;property&gt;<br>    &lt;name&gt;fs.s3a.aws.credentials.provider&lt;/name&gt;<br>    &lt;value&gt;<br>          com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper<br>    &lt;/value&gt;<br>&lt;/property&gt;</pre><p>With this change, the S3AFileSystem will use the same mechanism as the application itself to get the AWS credentials.</p><h3>Conclusion</h3><p>This was a great learning experience for us as we got a chance to dive into the internal workings of various AWS components and it provided us with a wealth of knowledge. Although ECS has excellent documentation on the whole setup, I still needed to go through numerous other articles and forums to learn about the internal workings and resolutions to the above issues. I hope you find this post useful to resolve some of your issues and to learn more about how ECS works. If you do, we would appreciate some feedback in comments or claps.</p><h3>References</h3><ol><li><em>AWS ECS Blog:</em> <a href="https://aws.amazon.com/blogs/compute/building-blocks-of-amazon-ecs/">https://aws.amazon.com/blogs/compute/building-blocks-of-amazon-ecs/</a></li><li><em>AWS ECS Setup: </em><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/get-set-up-for-amazon-ecs.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/get-set-up-for-amazon-ecs.html</a></li><li><em>Hadoop-AWS Documentation: </em><a href="https://hadoop.apache.org/docs/current/hadoop-aws/tools/hadoop-aws/index.html">https://hadoop.apache.org/docs/current/hadoop-aws/tools/hadoop-aws/index.html</a></li><li><em>Shunting Yard:</em> <a href="https://github.com/HotelsDotCom/shunting-yard">https://github.com/HotelsDotCom/shunting-yard</a></li><li><em>Docker on EC2:</em> <a href="https://hackernoon.com/running-docker-on-aws-ec2-83a14b780c56">https://hackernoon.com/running-docker-on-aws-ec2-83a14b780c56</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1288bfb89fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/expedia-group-tech/elastic-container-service-when-aws-documentation-is-not-enough-d1288bfb89fb">Elastic Container Service — When AWS Documentation is not enough</a> was originally published in <a href="https://medium.com/expedia-group-tech">Expedia Group Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating Spring Applications from DropWizard Metrics to Micrometer]]></title>
            <link>https://medium.com/expedia-group-tech/migrating-spring-applications-from-dropwizard-metrics-to-micrometer-5433f481f541?source=rss-54d5698663f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5433f481f541</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[micrometer]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Abhimanyu Gupta]]></dc:creator>
            <pubDate>Tue, 23 Oct 2018 10:22:36 GMT</pubDate>
            <atom:updated>2019-08-27T12:47:48.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*HMmPUAlb_5w9suXeddf0hg.png" /></figure><h4>A step by step guide to migrate Spring applications to Micrometer</h4><p>In Hotels.com’s Big Data Platform team we have a few products which use <a href="https://spring.io/">Spring</a> for the amazing capabilities it provides. We had been importing the <a href="http://platform.spring.io/platform/">spring-io-platform</a> Platform BOM to enable Spring in our products until recently when we found that it’s nearing <a href="https://spring.io/blog/2018/04/09/spring-io-platform-end-of-life-announcement">end of life</a> in April, 2019. One such product is our widely used request routing Hive Metastore Proxy service, very fondly known as <a href="https://github.com/HotelsDotCom/waggle-dance">Waggle Dance</a>.</p><p>Pivotal recommends that the users switch to using Spring Boot’s Dependency management directly by importing spring-boot-dependencies. So that’s what we started with. As the project was being directly ported over to Spring Boot — 2.0.4, a number of breaking changes were expected. Although there are a lot of things which have <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes">changed</a> since the previous version of Spring Boot, not all of them had an impact on our module.</p><h3>Getting Started</h3><p>Spring Boot requires Java 8 as the minimum Java version. This was not very difficult to update — a few small <a href="https://github.com/HotelsDotCom/waggle-dance/pull/128">tweaks</a> in the POM files did the job for us. Once Waggle Dance was upgraded to Java 8, we replaced Spring IO Platform dependencies with Spring Boot.</p><p>Replace</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;io.spring.platform&lt;/groupId&gt;<br>  &lt;artifactId&gt;platform-bom&lt;/artifactId&gt;<br>  &lt;version&gt;${spring-platform.version}&lt;/version&gt;<br>  &lt;type&gt;pom&lt;/type&gt;<br>  &lt;scope&gt;import&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p>with</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>  &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;<br>  &lt;version&gt;2.0.4.RELEASE&lt;/version&gt;<br>  &lt;type&gt;pom&lt;/type&gt;<br>  &lt;scope&gt;import&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p>The change which was breaking for Waggle Dance and is the subject of this post was that Spring Boot 2.0 no longer ships with its own metrics APIs. Instead, it relies on <a href="https://micrometer.io/">Micrometer</a> for all application monitoring needs. Now, let’s dive into how a Spring Application can be migrated to Micrometer.</p><h3>Metrics with Micrometer</h3><p>From Micrometer’s documentation:</p><blockquote><em>Micrometer is a simple facade over the instrumentation clients for the most popular monitoring systems, allowing you to instrument your JVM-based application code without vendor lock-in. </em><strong><em>Think SLF4J, but for metrics</em></strong><em>.</em></blockquote><p>Micrometer comes by default with Spring Boot, so no additional dependency needs to be added to the POM file. As it is agnostic of the underlying monitoring system, you need to provide a specific meter registry jar on the classpath. Once this registry is provided, Spring Boot automatically instantiates a MeterRegistry bean for that particular vendor type and it can then be simply injected into the class where it needs to be used.</p><p>As Waggle Dance uses Graphite for its Metrics Store, we provided micrometer-registry-graphite.</p><p>Added:</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;io.micrometer&lt;/groupId&gt;<br>  &lt;artifactId&gt;micrometer-registry-graphite&lt;/artifactId&gt;<br>  &lt;version&gt;1.0.7&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Old Dropwizard dependencies which were explicitly required to be added earlier can also be removed from the POM file as micrometer uses Dropwizard under the covers.</p><p>Removed:</p><pre>&lt;!-- Dropwizard --&gt;<br>&lt;dependency&gt;<br>  &lt;groupId&gt;io.dropwizard.metrics&lt;/groupId&gt;<br>  &lt;artifactId&gt;metrics-core&lt;/artifactId&gt;<br>  &lt;version&gt;${dropwizard.metrics.version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>  &lt;groupId&gt;io.dropwizard.metrics&lt;/groupId&gt;<br>  &lt;artifactId&gt;metrics-graphite&lt;/artifactId&gt;<br>  &lt;version&gt;${dropwizard.metrics.version}&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>  &lt;groupId&gt;io.dropwizard.metrics&lt;/groupId&gt;<br>  &lt;artifactId&gt;metrics-jvm&lt;/artifactId&gt;<br>  &lt;version&gt;${dropwizard.metrics.version}&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Micrometer also configures a CompositeMeterRegistry internally which can hold different types of meter registries. As we needed to provide the same metrics through JMX, we also provided a JMX Meter Registry on the classpath.</p><p>Added:</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;io.micrometer&lt;/groupId&gt;<br>  &lt;artifactId&gt;micrometer-registry-jmx&lt;/artifactId&gt;<br>  &lt;version&gt;1.0.6&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Similarly, a number of other <a href="http://micrometer.io/docs/concepts#_supported_monitoring_systems">supported registries</a> can be provided on the classpath and Spring Boot will make the corresponding Meter Registry bean available to Autowire out of the box.</p><pre>@Autowired MeterRegistry meterRegistry;</pre><h3>API Changes</h3><p>Instead of injecting <em>CounterService</em> or <em>GaugeService</em> instances in your application code, you can now create various metrics by:</p><ul><li>Injecting a <em>MeterRegistry</em> and calling methods on it like</li></ul><p>meterRegistry.counter(metricName).increment();</p><ul><li>Directly calling <em>static</em> methods like</li></ul><p>Counter featureCounter = Metrics.counter(&quot;feature&quot;);</p><p>A very interesting change which we found was that the Function Call duration metrics like <strong><em>all.duration.count, all.duration.m15_rate, all.duration.max, duration.mean_rate, all.duration.p50 </em></strong>etc. which we were getting earlier by using a GaugeService are available in Micrometer through MeterRegistry’s timer():</p><pre>meterRegistry.timer(metricName).record(Duration.ofMillis(value))</pre><p>For those using <strong>Graphite</strong> as their metrics store, another important change to be aware of is that the default GraphiteProtocol is now GraphiteProtocol. PICKLED. The <a href="https://graphite.readthedocs.io/en/latest/feeding-carbon.html">Pickle protocol</a> is a much more efficient take on the plaintext protocol, and supports sending batches of metrics in one go. So, if you are already using Graphite in a way that expects plain text (e.g. a Grafana dashboard) you will have to explicitly specify it as GraphiteProtocol.PLAINTEXT.</p><h3>Metrics changes</h3><p>The following modifications are needed if you are tracking the JVM metrics described below and want to achieve equivalency:</p><ul><li>memory.heap.used -&gt; sum(jvm.memory.used.area.heap.id.*) - i.e. you now need to sum up all the heap spaces</li><li>memory.heap.max` -&gt; sum(jvm.memory.max.area.heap.id.*) - i.e. you now need to sum up all the max used heap spaces</li><li>threads.*` -&gt; jvm.threads.*</li></ul><p>This migration was a very good learning experience for us and involved lots of experimentation with Spring Boot 2 and Micrometer. The <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide">migration guide</a> provided by Spring Boot does not cover Micrometer in detail and we had to read a lot of articles on the web along with Micrometer’s internal code to get answers to some of our questions. During the course of this work, we also reported a <a href="https://github.com/micrometer-metrics/micrometer/issues/853">bug</a> in the Micrometer project and got it fixed.</p><p>All these changes can be referred to in our pull-request <a href="https://github.com/HotelsDotCom/waggle-dance/pull/132/files">here</a>.</p><p>We hope that this article will be useful for people starting to use Micrometer. Please leave your suggestions and feedback in the comments.</p><h3>References</h3><ol><li><em>Spring IO end-of-life Announcement:</em> <a href="https://spring.io/blog/2018/04/09/spring-io-platform-end-of-life-announcement">https://spring.io/blog/2018/04/09/spring-io-platform-end-of-life-announcement</a></li><li><em>Spring Boot 2 Migration Guide:</em> <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide">https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide</a></li><li><em>Dependencies Provided by Spring-Boot-2:</em> <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html">https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html</a></li><li><em>Quick Guide to Micrometer:</em> <a href="https://www.baeldung.com/micrometer">https://www.baeldung.com/micrometer</a></li><li><em>Dzone Article on Migrating Dropwizard Metrics to Micrometer</em> — <a href="https://dzone.com/articles/spring-boot-2-migrating-from-dropwizard-to-micrometer">https://dzone.com/articles/spring-boot-2-migrating-from-dropwizard-to-micrometer</a></li><li>Waggle-Dance Pull Request: <a href="https://github.com/HotelsDotCom/waggle-dance/pull/132/files">https://github.com/HotelsDotCom/waggle-dance/pull/132/files</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5433f481f541" width="1" height="1" alt=""><hr><p><a href="https://medium.com/expedia-group-tech/migrating-spring-applications-from-dropwizard-metrics-to-micrometer-5433f481f541">Migrating Spring Applications from DropWizard Metrics to Micrometer</a> was originally published in <a href="https://medium.com/expedia-group-tech">Expedia Group Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>