<?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 Manuel Mourato on Medium]]></title>
        <description><![CDATA[Stories by Manuel Mourato on Medium]]></description>
        <link>https://medium.com/@manuelmourato25?source=rss-92315a802bf0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BT-RXmuplpKvJLi0G4UBdg.jpeg</url>
            <title>Stories by Manuel Mourato on Medium</title>
            <link>https://medium.com/@manuelmourato25?source=rss-92315a802bf0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:00:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manuelmourato25/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[ELK Stack + Alerting: How to Monitor your Business and Infrastructure Data (Part One)]]></title>
            <link>https://medium.com/@manuelmourato25/elk-stack-alerting-how-to-monitor-your-business-and-infrastructure-data-part-one-a4a1c3427745?source=rss-92315a802bf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4a1c3427745</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Manuel Mourato]]></dc:creator>
            <pubDate>Tue, 14 May 2019 14:01:53 GMT</pubDate>
            <atom:updated>2019-05-14T14:01:53.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNTE3K7h8-jTOAHRdTGbHQ.png" /></figure><h3>Before we begin</h3><p>As per usual with these little posts of mine, if you already know what the ELK stack is and how it works, please feel free to go to this <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example"><strong>github repository</strong></a> , in which you have a dockerized implementation for each of the services I’m about to mention bellow.</p><p>Note that this is the<strong> first part of a two part article</strong>. In the next instance, I shall discuss the <strong>Prometheus Framework, together with Grafana and Elastalert</strong>. Stay Tooned!</p><h3>Introduction</h3><p>In the last few years, the volume of data for a multitude of organizations has increased exponentially.</p><p>With this fact at hand, many times the question that arises is: does my data have quality? Does it fit into my companies business logic?</p><p>Similarly, the amount of services running at a time to accommodate for the business requirements, particularly of software companies, poses other questions, like: Is service X running correctly? Do I have the necessary disk space and memory to perform the data processing that is needed. What if I go home and everything crashes while I sleep?</p><p>This document explores how we can solve these issues, by using what is called an “ELK Stack”, plus a few extra treats .</p><p>First a description of the two main types of data related metrics will be presented. Then, an overview of all the different services involved in the proposed architecture will be explored, alongside a comprehensive explanation of how data is ingested, processed and visualized.</p><h3>Proposed Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*E6zudGYmF9gK2EbFMdAQRg.png" /><figcaption>ELK Stack + Elastalert</figcaption></figure><h3>Analytics Metrics</h3><p>For any type<strong> </strong>kind of software development team, there are two main types of metrics that have to be recorded and studied:<strong> Business Data Metrics &amp; Infrastructure Data Metrics</strong>.</p><p><strong>Business Data Metrics</strong></p><p>Business Data is the data that the organization uses to derive insights. It can be anything from sales data to client information data, website viewing information details, etc.</p><p>Usually metrics about business data are related to data quality and consistency based on specific business rules, usually defined by a Product Owner or similar .</p><p>Data sources for this type of metrics, will be database engines, such as SQL Server or Oracle.</p><p><strong>Infrastructure Data Metrics</strong></p><p>Infrastructure Data is the data that does not directly influence a company’s strategic insight, but it informs the developers and system administrators about infrastructure details. Such metrics can be something like “Check if a crucial service is up or down”,”What is the current cpu/memory/disk usage for our machines?” or “What is the current duration of our ETLs/general processes?”</p><p>Usually metrics about infrastructure are defined by System Administrators, who understand the needs of the organization in terms of infrastructure, on the short and long term.</p><p>Data sources for this type of metrics, for the presented use case, will be information about the local server in which the docker services are running, plus the metrics from a Kafka single node Cluster , also running within a container.</p><h3>Analytics Monitoring Infrastructure Overview</h3><h3>Logstash</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*T2ssi6NiNCQ1RCNW1sHvFA.png" /></figure><p>“ Logstash is an open source, server-or mside data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite stash.” — quote by Elasticsearch Co.</p><p>In Logstash, we can define pipelines, in which we specify the datasources from which we want to collect our data, followed by filters if necessary, and finally a data sink to which we can send our data.</p><p>I will now provide a detailed explanation of how to set up a series of logstash pipelines, which we can use to access, as an example, tables from an SQLSERVER instance.</p><p>All mentioned files may be found in <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/logstash">this repository folder</a></p><p><strong>logstash.yml → logstash/config</strong></p><p>You can set options in the Logstash settings file, logstash.yml, to control the Logstash service execution. For example, you can specify pipeline settings, the location of configuration files, logging options, and other settings.</p><p>Pipeline specific configurations are not defined in this file for this use case, since we use multiple pipelines, each with its own configuration file.</p><p>The most notable configurations that we want to set for all our pipelines, and therefore should define in this file, are the Queuing Settings and Logging Settings.</p><p>In this case, a queuing persistence of 1GB of data was defined for our application.</p><p><strong>pipelines.yml → logstash/config</strong></p><p>This is the file in which we specify which pipelines have to be executed by the Logstash instance, along with configurations that are specific to each pipeline, for example number of workers to execute it, data batch size to process at a time, etc .</p><p><strong>jdbc-sql-pipeline.conf → logstash/pipeline</strong></p><p>A pipeline has three major components, an input, filter and output.</p><p>Each input can have multiple data sources of different types, for example a query that fetches data from a specific table and database engine type, a Kafka consumer that extracts data from a specific topic, etc .</p><p>More information about input types can be found here: <a href="https://www.elastic.co/guide/en/logstash/current/input-plugins.html">https://www.elastic.co/guide/en/logstash/current/input-plugins.html</a></p><p>Filter is an optional parameter which performs actions based on the specific received events. Examples of these actions can be to extract fields from unstructured data (grok) or to truncate fields longer than a certain length (truncate), etc. For this use case, the filter plugin was not necessary.</p><p>More information can be found here: <a href="https://www.elastic.co/guide/en/logstash/current/filter-plugins.html">https://www.elastic.co/guide/en/logstash/current/filter-plugins.html</a></p><p>Finally we define the output to which we want to send the collected/filtered data, in our particular case an Elasticsearch instance. The only thing we have to specify is the index to which we want to write the data, alongside optional parameters .</p><p>More information about output types can be found here: <a href="https://www.elastic.co/guide/en/logstash/current/output-plugins.html">https://www.elastic.co/guide/en/logstash/current/output-plugins.html</a></p><p>In our use case, for simplicity sake, we have a single pipeline that extracts data from an SQLServer table to Elasticsearch:</p><pre>input {<br>  jdbc {<br>    jdbc_driver_library =&gt; &quot;/opt/logstash/drivers/sqljdbc41.jar&quot;<br>    jdbc_driver_class =&gt; &quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;<br>    jdbc_connection_string =&gt; &quot;jdbc:sqlserver://&lt;HOST&gt;;InstanceName=&lt;INSTANCE&gt;;DatabaseName=&lt;DATABASE&gt;;&quot;<br>    jdbc_user =&gt; &quot;USERNAME&quot;  <br>    jdbc_password =&gt; &quot;PASSWORD&quot; <br>    parameters =&gt; { &quot;table_name&quot; =&gt; &quot;TABLE_NAME1&quot; }<br>    schedule =&gt; &quot;* * * * *&quot;<br>    statement =&gt; &quot;SELECT count(1) as TABLE1_RECORD_COUNT_SQL from TABLE_NAME1&quot;<br>  }</pre><pre>jdbc {<br>    jdbc_driver_library =&gt; &quot;/opt/logstash/drivers/sqljdbc41.jar&quot;<br>    jdbc_driver_class =&gt; &quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;<br>    jdbc_connection_string =&gt; &quot;jdbc:sqlserver://&lt;HOST&gt;;InstanceName=&lt;INSTANCE&gt;;DatabaseName=&lt;DATABASE&gt;;&quot;<br>    jdbc_user =&gt; &quot;USERNAME&quot;  <br>    jdbc_password =&gt; &quot;PASSWORD&quot; <br>    parameters =&gt; { &quot;table_name&quot; =&gt; &quot;TABLE_NAME2&quot; }<br>    schedule =&gt; &quot;* * * * *&quot;<br>    statement =&gt; &quot;SELECT count(1) as TABLE2_RECORD_COUNT_SQL from TABLE_NAME2&quot;<br>  }</pre><pre>}<br>output {<br>  elasticsearch {<br>    hosts =&gt;  &quot;ES_HOST:ES_PORT&quot;   <br>    index =&gt; &quot;business-metrics&quot;<br>    document_type =&gt; &quot;long&quot;<br>  }<br>}</pre><p>As you can see, it is a fairly simple approach to collect data via a jdbc connection. Bare in mind that the alias given to the query fields that you want to extract, will be the name or names given to the metrics that will be recorded in the index from the ES instance.</p><h3>MetricBeat</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/0*CIB2i22wxWmkGsob.jpg" /></figure><p>“Metricbeat is a lightweight way to send system and service statistics. The user can collect metrics from its systems and services.” — quote by ElasticSearch Co.</p><p>This service differs from Logstash in the sense that it is optimized to collect metrics more than actual business data, so it is ideal when we want to collect performance variables from our other services, for example the heap memory used by an SQL server or a local machine, the amount of disk space available, check if a Kafka Cluster has an assigned leader, and many more.</p><p>Similarly to Logstash, Metricbeat works by defining the input sources from which we want to collect metrics and the output instance to which we want to send them. We can also define how many workers should handle the collection of data, collection intervals, retries,etc.</p><p>The configuration .yml file can be found <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/metricbeat">here</a>.</p><p><strong>metricbeat.yml → metricbeat</strong></p><p>As you can see, for this use case, we will define two input sources to extract system metrics from: a Kafka single node cluster and the machine in which the MetricBeat service is running.</p><p>The output on the other hand will again be an Elasticsearch instance, this time to an index named infrastructure-metrics (line 119 from the configuration file).</p><h3>Elasticsearch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*iJVPAlXBdDCXIDpo.png" /></figure><p>“Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.” — quote by ElasticSearch Co.</p><p>To make matters more intuitive, the table bellow shows the parallelism that exists between an ElasticSearch instance and a generic Relational Database instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*o26kKsCQ8tyjfy5dM3rYLQ.png" /></figure><p>ElasticSearch is therefore a NoSQL database engine, which receives Documents in JSON format. A Document is nothing more than an association between Field names and Values, essentialy what we would call a record in an SQL server table.</p><p>There is a specific Mapping associated to those Documents, that defines their field types, as well as how they shall be indexed in the Elasticsearch instance.</p><p>Each document is only stored and becomes searchable when it is associated to an index.</p><p>A simple example of the index-mapping-document hierarchy can be found bellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*I4-6PY7KPogLnM5vYP9JZQ.png" /></figure><p>Note that one of the biggest advantages of storing data is this manner, is that we are not obligated to have a fixed schema, such as a table in which, for example, we cannot insert a value for a field that was not previously created. So for example, if we wanted to add a field named “last” to the name structure above, we could do it at the time of the document insertion into an index.</p><p>In our use case, we have defined two indexes already mentioned above: business-metrics and infrastructure-metrics. We can very easily visualize these indexes by executing the command bellow in our localhost instance (if you have started the Logstash + MetricBeat + Elasticsearch services provided in this <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example">Git Repository</a>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4ktUC3OgZ9QrMF-6KnnnQ.png" /></figure><p>The configuration .yml file for our Elasticsearch instance can be found <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/elasticsearch">here</a>:</p><p><strong>elasticsearch.yml → elasticsearch</strong></p><p>Configuring an Elasticsearch instance or cluster has some similar aspects to configuring a relational database instance: setting how many replicas should exist per index, how many partitions (shards) should exist per index, paths to where the data should be written, etc .</p><p>For this use case, since we are only launching a single Elasticsearch instance with a reasonable amount of data per index, increasing replication and sharding does not make much sense, so the impact of these parameters will not be evaluated.</p><p>The above explanation only touches slightly upon all features that Elasticsearch offers. For a complete guide, please refer to <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html">this guide</a>.</p><h3>Kibana</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/0*SH5k8MId8_ZUeYUf.png" /></figure><p>“Kibana is a window into the Elastic Stack. It enables visual exploration and real-time analysis of your data in Elasticsearch.”</p><p>It allows us as developers to create different types of dashboards, that we can check everyday to monitor the metrics we defined in the previous steps above.</p><p>The configuration .yml for the Kibana service can be found<a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/kibana"> here</a>:</p><p><strong>kibana.yml → kibana</strong></p><p>It basically contains similar configurations to the ones we have seen in the services above: where to fetch the metrics so they can be represented in visualizations (in this case the Elasticsearch instance); where to write logs, time interval to fetch metrics,etc.</p><p>Once Kibana is up and running, the first thing we have to do is to create an index pattern for one or more indexes from Elasticsearch.</p><p>In our case, we have metrics from two indexes: the infrastructure-metrics index and the business-metrics index. Thus, we can create index patterns following the example bellow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*3gQc6Yqyucs21FH85IKUrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*ERPblfrU1NlIUKj2H0sU7Q.png" /></figure><p>After creating these patterns, we can now create visualizations and put them in a dashboard that we can check everyday, in real time.</p><p>For the example of business-metrics, we have the visualizations bellow, which compares the records from the two tables defined in the Logstash above (TABLE1 in dark purple and TABLE2 in light purple).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*NhxqeqWV1RR46uKejLDgEw.png" /></figure><p>For the example of infrastructure-metrics, we have the visualizations bellow, in which we can check the available memory in our machine, the number of Kafka offsets at a given time, or if there exists a leader replica for each topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1rYparFK5U-AnGNutYJ_A.png" /></figure><h3>Elastalert</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/0*rziSYzouC_HIq47R" /></figure><p>Finally we present what is probably the most useful service from all the ones presented: Elastalert. Suppose you have your dashboards set up and ready to be checked whenever you want. The fact that you need to interrupt your work to view your dashboards and analyse visualizations one by one, to see if there is an issue, is very impractical.</p><p>ElastAlert is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch.</p><p>It works by combining Elasticsearch with two types of components, rule types and alerts. Elasticsearch is periodically queried and the data is passed to the rule type, which determines when a match is found. When a match occurs, it is given to one or more alerts, which take action based on the match.</p><p>There are multiple rule types, and multiple alert sinks to which to send warnings (email,slack, etc).</p><p>This project was developed by Yelp, and it can be found in the following repository: <a href="https://github.com/Yelp/elastalert">https://github.com/Yelp/elastalert</a> .</p><p>So essentially, Elastalert will warn developers if any of the defined rules as been violated.</p><p>The configuration files for Elastalert can be found <a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/elastalert">here</a>:</p><p><strong>elastalert.yaml → elastalert/config</strong></p><p>In the above file we define the instance where elastalert will apply its rules (an Elasticsearch instance). We can also define the interval in which elastalert will query elasticsearch and the folder in which the configured rules should be specified.</p><p><strong>config.json → elastalert/config</strong></p><p>The above file contains the general configuration for the REST endpoint provided by the Docker container to the outside host. This files not need it if you are running a bare metal installation of Elastalert without docker.</p><p><strong>memory_high_alert.yaml → elastalert/rules</strong></p><p><strong>table_empty_alert.yaml → elastalert/rules</strong></p><p>In the above files, we define two different rules which will trigger a warning in a specific Slack channel.</p><p>First we specify the index in which to search for the mentioned metrics for the rule, as well as the time interval to wait between one alert and the next.</p><p>If we don’t want an alert to trigger right away, we can define the number of times that an event should happen until an alert is launched.</p><p>Finally, we define the filter which applies the rule we want to check for. For this use case, two rules were defined:</p><p>1) Check if the server memory is too high: in this rule we set a maximum threshold, and check if the memory used by the server in which metricbeat is running is above that value. Note that currently the docker containers that were initialized share the same memory and disk space with the machine in which they are running. If we were too provide more isolation between containers (set fixed amount of memory and disk space to use), then this alert wouldn’t be a correct reflection of what is happening with the machine’s overall memory.</p><p>2) Check if a certain table is empty, The name is pretty self explanatory. Based on the Logstash queries defined above, we can check the table counts for specific tables and compare them to a given default value.</p><p>For the first rule I used a range filter , and in the second one I used scripted language for Elasticsearch. More about defining rules in Elastalert can be found here: <a href="https://elastalert.readthedocs.io/en/latest/index.html">https://elastalert.readthedocs.io/en/latest/index.html</a></p><p>These are examples for the alerts shown in Slack, for the rules defined above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*fjdB7OPigsRfqcDU3neiuQ.png" /></figure><h3>Notes about authentication and user access management</h3><p>As a final note about security and access management, X-Pack is an Elastic Stack extension that bundles security, alerting, monitoring, reporting, and graph capabilities into one easy-to-install package. While the X-Pack components are designed to work together seamlessly, you can easily enable or disable the features you want to use.</p><p>With this x-pack we can easily limit the access to certain dashboards to specific users, as well as to define credentials for different users, adopt certain security protocols when transferring data, etc,</p><p>The issue with this package is that it is a paid one, and as such was not explored for this solution.</p><p>An alternative for user management and such, is to use NGINX, a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. In this use case, NGNIX could be used as a reverse proxy, acting as an additional layer between a potential user/client , and the dashboards we want to make available (only to certain users).</p><p>A simple implementation for NGINX in this context, is defined<a href="https://github.com/ManuelMourato25/elastic-stack-architecture-example/tree/master/ngnix/sites-enabled"> in this file</a>:</p><p><strong>kibana → ngnix/sites-enabled</strong></p><pre>server {<br>    listen 9299;<br>    server_name &lt;SERVER_IP&gt;;</pre><pre>location / {<br>        proxy_pass <a href="http://172.20.10.47:5601;">http://</a>KIBANA_HOST<a href="http://172.20.10.47:5601;">:5601;</a><br>        auth_basic &quot;Restricted Content&quot;;<br>        auth_basic_user_file /etc/nginx/.htpasswd;</pre><pre>}<br>}</pre><p>In this example we define the port to which the client should access. NGINX then requests a set of credentials defined in the <strong>.htpasswd </strong>file.</p><p>If the credentials are correct, access will be redirected to the server and port defined in proxy_pass .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*-tY0WhKaKtfE15tsB0x5Hw.png" /></figure><h3>Conclusions</h3><p>The ELK stack, allied with the potential that Elastalert brings to the table, is indeed a worthwhile solution to explore.</p><p>The only issues I have with this architecture can be summarized as follows:</p><ol><li>Kibana’s visualization options make it slightly difficult to present the current values for a specific metric, even though it is still possible. It solely works with field aggregations, as discussed in the following issue: <a href="https://github.com/elastic/kibana/issues/678">https://github.com/elastic/kibana/issues/678</a></li><li>Because Elastalert uses the same query language used by Elasticsearch, <a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl.html">Query DSL</a>, optimized to query JSON format documents, it becomes hard to perform certain SQL like queries, in which we want to compare metrics with each other, and apply multiple conditions for our alerts with an SQL like syntax.</li></ol><p>The issues above are solved by using the <strong>Prometheus Framework</strong>, an alternative architecture for the monitoring of services and applications, very similar to the ELK stack, but with a few distinct features of its own.</p><p>Part Two of this article shall be based in this framework.</p><p>And that is all for now. I hope you enjoyed!</p><p>Please give your opinions and suggestions bellow!</p><p>Manuel Duarte Vilarinho Mourato @ Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4a1c3427745" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Airflow isn’t fast enough: Distributed orchestration of multiple small workloads with Celery]]></title>
            <link>https://medium.com/@manuelmourato25/when-airflow-isnt-fast-enough-distributed-orchestration-of-multiple-small-workloads-with-celery-afb3daebe611?source=rss-92315a802bf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/afb3daebe611</guid>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[celery]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Manuel Mourato]]></dc:creator>
            <pubDate>Fri, 20 Apr 2018 16:15:43 GMT</pubDate>
            <atom:updated>2018-04-20T16:17:08.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*PQY6e6e3hWzMpxsTXEzNlg.png" /></figure><p><strong>DISCLAIMER 1: </strong>If you already have a firm knowledge on what orchestration, Apache Airflow and Celery are, go directly to the “<strong>An Airflow use case: managing an ETL for user data extraction, processing and storage</strong>” section just to get a feel of the example use case, and then start reading from “<strong>The problem with fast tasks and Airflow</strong>”</p><p><strong>DISCLAIMER 2:</strong> Seasoned data engineers might find this comparison a bit weird, since Airflow can and should work together with Celery. This is all addressed bellow, so do give me a chance! :)</p><h4>What is orchestration and why you should care</h4><p>When working with data of any kind, there are always three basic steps that need to be accomplished, commonly known in the most basic scenarios as ETL processes:</p><ul><li>Get the data from a given source.</li><li>Process it so it gives us the insights we are looking for.</li><li>Load/insert the data into a database or persistence of any kind, so interested parties can query it with ease.</li></ul><p>In order to illustrate, let’s consider the following scenario:</p><ul><li>We have website user data in the form of logs, that arrive to our server on an hourly basis, and we want to store them in a MySQL server table.</li><li>We first need to extract the data from disk, process it so that the schema fits the existing table, and finally load the data to the MySQL sever.</li></ul><p>Now, if we were to design this as a DAG of tasks (direct acyclic graph), just to get a feel of the steps we are dealing with, we would get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*hhu79JAXfnT8f-SezFs7pA.png" /></figure><p>And finally, via a cron instruction such as this<br> “ 0**** ” <br>we would be able to execute the ETL every hour.</p><p>Fairly simple right? The problem though, is that in a company/business context, you rarely have one single workflow with a fixed set of tasks. You have multiple data sources, multiple workflows, task dependencies on other tasks or workflows, specific different schedules for each workflow, specific deadlines, multiple scenarios based on task success or failure, etc.</p><p>So you can see very quickly that instead of having a workflow like the one shown above, you end up with something like this instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*P3Ytaj--UNXmzC1DfUtNtg.jpeg" /></figure><p>Orchestration tools serve as a means to facilitate this coordination of tasks and workflows, allowing to even perform distributed coordination using multiple machines inside a cluster, if you have a lot of processes or a lot of data to process.</p><p>One of the most popular orchestrators right now is Apache Airflow, which I’m now going to talk about.</p><p><strong>Apache Airflow</strong></p><p>I really can’t define Airflow any simpler than the description in the documentation: <em>“ Airflow is a platform to programmatically author, schedule and monitor workflows” .</em></p><p>So in essence, Airflow is an orchestrator that allows for two important things, targeted for different groups of people:</p><ul><li>For developers, it makes it extremely simple to create complex ETL scheduling in a programmatic way, using Python scripts. Each workflow, much like the example in the previous section, is a DAG of tasks that need to be executed in a certain order and scheduled.</li><li>Airflow also presents the concept of operators and hooks, which facilitates the programming of diverse tasks, from sending data from S3 to Hive, to sending a message to a Slack channel.</li><li>For product owners/leads on the other hand, it provides a rich UI,with which tasks can be monitored in real time, be it via graphical representations of the DAGs, their execution times and current status, or even by giving us an SQL engine in which we can use standard queries to get the state of a certain workflow or task, as well as their history.</li></ul><p>But let’s take a look at a practical example.</p><p><strong>An Airflow use case: managing an ETL for user data extraction, processing and storage</strong></p><p>Imagine we have a three step ETL to extract user data from a raw JSON file, process it and load it to an SQL table. This ETL should run on a 30 minute basis.</p><p>This is an example of how the raw data looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*FbREknSUb5pDqgkDKze8ag.png" /></figure><p>The goal now, is to get the data into a SQL table like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*oqkDyQXUydtuzvWr-_Bifw.png" /></figure><p>The scripts we need to accomplish these three tasks are actually quite simple to implement, and you can find them all in the following git repository <a href="https://github.com/ManuelMourato25/airflow_celery_example_project/tree/master/airflow/working_dir">https://github.com/ManuelMourato25/airflow_celery_example_project/tree/master/airflow/working_dir</a></p><p>In order to simply test Airflow though, you don’t need to understand the ETL tasks; just follow the steps bellow to get your Airflow host/cluster up and running :</p><ul><li><strong>Install Airflow: </strong>This of course is a given. You can find a fantastic installation guide here for both Ubuntu and CentosOS: <a href="http://site.clairvoyantsoft.com/installing-and-configuring-apache-airflow/">http://site.clairvoyantsoft.com/installing-and-configuring-apache-airflow/</a> <br>Don’t forget to install RabbitMQ and Celery, just as the instructions describe, as well as setup your MySQL server.</li><li><strong>Getting Airflow scripts:</strong> As I mentioned above, Airflow is capable of scheduling and managing ETL tasks using simple Python scripts. You can obtain the scripts for this specific project by simply cloning the following git repository: <a href="https://github.com/ManuelMourato25/airflow_celery_example_project">https://github.com/ManuelMourato25/airflow_celery_example_project</a></li><li><strong>Placing scripts in their respective directories:</strong> <br>First, go to the airflow/ folder<br>Place working_dir/ in your root dir ( / )<br>Place data_dir /in your root dir ( / )<br>Place the dags/ folder in your AIRFLOW_HOME dir<br>Place the airflow.cfg fle in your AIRFLOW_HOME dir</li><li><strong>Tweak airflow.cfg:</strong> This file contains end_points and urls that you need to change to fit your own environment, so take your time examining this file.</li><li><strong>Start Airflow services:<br></strong>Start airflow webserver in your webserver host, or locally<strong><br></strong>Start airflow scheduler in your scheduler host, or locally</li></ul><p>If everything went well, you should see the following UI by going into http://&lt;webserver_hostname&gt;:8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUTVy9mKN_adN9NnY2OuEg.png" /></figure><p><strong>Running Airflow in a distributed fashion: Enter Celery</strong></p><p>If you take a look at airflow.cfg, you will notice that there are several options for the “executor” field, that is, the engine that will execute your scheduled tasks. And one of those options includes “CeleryExecutor”.</p><p>This is where you might get a little confused given the title of this article. Indeed Airflow can (and in fact it is preferred) use Celery workers as an engine to execute the scheduled tasks that we mentioned above. But what is Celery exactly? It’s actually not that hard to explain.</p><p><em>“ Celery is an asynchronous task queue/job queue based on distributed message passing”.</em></p><ul><li>The way Celery works, is that it connects to a queuing framework, such as RabbitMQ.</li><li>This Rabbit server in turn, contains multiple queues, each of which receives messages from either an airflow trigger or an execution command using the Celery delay command.</li><li>Each of these messages are ordered, and tell the Celery executors what is the task that they need to execute next.</li><li>Celery executors can retrieve task messages from one or multiple queues, so we can attribute queues to executors based on type of task, type of ETL, etc.</li></ul><p>The great plus of using Airflow and Celery together, is that we can have Celery/Airflow workers running in multiple cluster hosts and distribute the execution of our ETL tasks in parallel, thus accelerating the execution of an ETL.</p><p>Knowing now how Celery works together with Airflow, we can execute the “rawFile_to_SQL” dag by performing the following steps:</p><ul><li>Go to the hosts where you want to run your workers, or alternatively just do it locally, and run airflow worker -q &lt;NAME_OF_QUEUE&gt;<br>This queue was specified in the ‘raw_file_to_sql.py’ script as being ‘ rawToSQL’.</li><li>Go to the web UI, and turn the “rawFile_to_SQL” DAG on.</li><li>If everything went well, the airflow worker should be showing execution logs for the current DAG.<br>Note: if you are executing the airflow worker as the root user, go to “~/.bashrc” and set the following variable “export C_FORCE_ROOT=true” before running “airflow worker -q &lt;NAME_OF_QUEUE&gt;”.</li></ul><p>By clicking on one of the triggered DAG executions, you should see the following in the UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFWo8w0gkK7mD2dnXZ1UXg.png" /></figure><p>Similarly, if you go to your MySQL server and run:<br>“USE user_db; SELECT * FROM processed_msg;”<br>You will see the following output table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*oqkDyQXUydtuzvWr-_Bifw.png" /></figure><p><strong>The problem with fast tasks and Airflow</strong></p><p>After seeing how smoothly our “Raw_to_SQL” ETL ran with Airflow performing its orchestration (hopefully!), you might be wondering what the title of this article is all about. Well, rather then tell you I should instead show you. <br>These are the Gantt charts (also an Airflow UI feature) for three different time instances in which the ETL has ran, with the task duration in green.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnON_4tinPvpRj4ZVGe3-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nhkW4wTy1Gsg1lERQlN9jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCf0bwHOy6J2UCvfp6MuIg.png" /></figure><p>Do you see the issue? The tasks themselves as you can see, are completed in less than one second, but the <strong>time between tasks is in the order of 4–5 seconds!</strong></p><p>Let’s think about this a little bit: if you have a use case in which your tasks are long and complex, moving or transforming big data, then a few seconds between each task is something you can spare, and if so Airflow would be ideal for you.</p><p>But let’s now consider a different scenario: you have iot/financial/user data coming from thousands of different sources to your cluster. The goal is for your client to have that data as fast as possible, to detect failures/tendencies/etc as soon as possible (under 10 or 30 seconds). In this situation, you have to launch an ETL process every time there is data for one of those thousands of sources, so the data amount itself is quite small each time.</p><p>So not only will you have a lot of concurrent ETL processes, but each of them will have some number of tasks that are run sequentially. In a situation like this, you can’t have an ETL process with 5 second breaks between tasks, especially if there are 5 or 10 or more tasks that run sequentially. The task scripts should be executed immediately, one after the other.</p><p>You may ask then: why not simply run the tasks in a single host? Since they are small and fast we should just execute the scripts inside the host, using something like cron for scheduling.</p><p>That could work, but if we have thousands of data sources and want the data from them as fast as possible, we will have a scenario in which we have thousands of tasks running concurrently and a single host might not have the cpu/memory to support them all.</p><p>But you might still be asking: well, why don’t we simply take all of the tasks that run sequentially, and put them in the same script? That would at least solve the intervals between tasks issue.</p><p>This is actually the perfect approach for the use case presented in the sections above. However, there are many scenarios in which this isn’t possible: for example,when you have a task that you want to run even if the previous task has failed. If all tasks are in the same script, if one step fails, the whole script fails, which is not ideal.</p><p>For all these issues with running a massive number of fast/small tasks , we require fast distributed task management, that does not require previous resource allocation (as Airflow does), as each ETL task needs very few resources, and allows tasks to be executed one after the other immediately.</p><p><strong>Celery Alone: why less can be more</strong></p><p>Apache Airflow, for the outlined reasons, is clearly not fit for this use case. So what if we remove Airflow’s heavy stuff, but leave the underlying task execution and management infrastructure? That, is simply Celery.</p><p>With Celery, sequential tasks not only execute immediately one after each other, but we also don’t have to allocate space previous to their execution, as we did in Airflow. <br>Each task is simple a script execution, and uses only the memory it needs to run its code.<br>It is a light weight real time solution, which fits this type of use case where you have ETLs that require extremely low latency, while still needing to execute a massive number of small tasks in the process.</p><p>Let’s see how Celery works in practice:</p><ul><li>Celery requires a backend if you wish to store your task results.<br>As such, the first thing thing you need to do, is to create a celery database in your MySQL server, and grant it privileges so you can access it:<br>“ CREATE DATABASE celery;<br>GRANT ALL PRIVILEGES ON celery.* TO &lt;username&gt;@’%’ IDENTIFIED BY ‘&lt;password&gt;’; ”</li><li>Next, go to the git repository that you cloned for the Airflow test, and enter the “celery folder/celery_for_medium/” folder.<br>In this folder you will find a script called “celery.py”. Open it and replace the values inside &lt;…&gt; with your respective server names and user/password.</li><li>Provided that you have already setup your directories and files as described in the “<strong>An Airflow use case: managing an ETL for user data extraction, processing and storage</strong>” section above, simply go back to the “celery/” directory and run the following command:<br>“celery worker — app celery_for_medium.celery — loglevel=INFO -n worker1@&lt;WORKER_SERVER&gt; -Q json_to_sql_celery”</li><li>If everything goes as planned, you should see the celery worker starting like so:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1MgPX3A8gvwfuAvXUWexQ.png" /></figure><ul><li>The steps above allowed us to start the Celery worker.<br>Now its time to give an execution order, so that tasks are sent to the “json_to_sql_celery” RabbitMQ, and as a consequence, Celery will read the task orders and execute them.<br>Simply open another window terminal and run <br>“python execution_script.py” on the same folder</li><li>Again if everything goes well, you should immediately see the celery worker showing execution logs, like so:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*orhUg9nI2WpAkLn5aWG9YQ.png" /></figure><ul><li><strong>Notice also that tasks are executed immediately one after the other, with no delay between them</strong>, the opposite of Airflow. <br>This can also be seen on the terminal where you executed “python execution_script.py”:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*WwDuZ12pmDiA6gJqTNFcJQ.png" /></figure><p>You may also notice that despite us having only one worker, the log presents multiple worker instances like “Worker-10”. This is because, even though we launched one worker, it is still performing tasks concurrently using the host’s threads. This concurrency level can be tuned.</p><ul><li>Finally, if you want to check your worker state, open another terminal and simple run “flower” (if it is not installed simply run “pip install flower” first) and you should be able to see the UI in port 5555:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IHgSe-2WSOX05FW-JzEiw.png" /></figure><p>Of course this comes with a few disadvantages:</p><ul><li>The intuitive Airflow UI that is incredibly useful for monitoring purposes, as well as many other features, is now not available.<br>You can still use “flower” to monitor Celery workers, but it can’t compare to the Airflow UI.</li><li>All the Airflow operators and hooks that made it extremely simple to interact with HDFS, Hive, execute bash commands,etc, are now not available as well.</li></ul><p><strong>Conclusion:</strong></p><p>Apache Airflow on Celery vs Just Celery depends on your use case. <br>For most scenarios Airflow is by far the most friendly tool, especially when you have big data ETLs in which tasks take a long time to execute. In these scenarios, a couple of seconds between tasks becomes negligible.</p><p>If however you have a special use case in which data comes at you really fast from multiple sources, where you need distributed computing but still incredibly fast latency, then I would say give Celery a shot.</p><p>I hope you enjoyed!</p><p>Please give your opinions and suggestions bellow!</p><p>Manuel Duarte Vilarinho Mourato @ Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afb3daebe611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Spark dataframe shuffling can hurt your partitioning]]></title>
            <link>https://medium.com/@manuelmourato25/how-spark-dataframe-shuffling-can-hurt-your-partitioning-28d05fdcb6fa?source=rss-92315a802bf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/28d05fdcb6fa</guid>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Manuel Mourato]]></dc:creator>
            <pubDate>Wed, 21 Feb 2018 15:11:50 GMT</pubDate>
            <atom:updated>2018-02-21T15:11:50.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/698/0*u1noledLKaJhXuuW.jpg" /></figure><p>For those who work with Spark as an ETL processing tool in production scenarios, the term shuffling is nothing new. It happens when we perform RDD operations like GroupBy or GroupByKey, which require that data is moved between partitions, in the same machine if you are lucky, or even between executers. But what does shuffling have to do with partitioning?</p><p>Well, nothing really if you are working with RDDs…but with dataframes, that’s a different story.</p><p>Let’s take a look at a simple example:</p><pre>&gt;&gt;&gt; sc.defaultParallelism <br>8 <br>&gt;&gt;&gt; number_list=sc.parallelize(xrange(0, 100, 1)) <br>&gt;&gt;&gt; number_list.collect() <br>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] </pre><pre>&gt;&gt;&gt; pair_number_list=number_list.map(lambda x:(1,x)) <br>&gt;&gt;&gt; pair_number_list.getNumPartitions() <br>8 <br>&gt;&gt;&gt; grouped_rdd=pair_number_list.groupByKey() <br>&gt;&gt;&gt; grouped_rdd.getNumPartitions() <br>8</pre><p>So we see that with RDDs the partitioning does not change. Let’s now do the same but with a Dataframe</p><pre>&gt;&gt;&gt; df=sqlContext.createDataframe(pair_number_list) <br>&gt;&gt;&gt; df.show(4) <br>+---+---+ <br>| _1| _2| <br>+---+---+ <br>|  1|  0| <br>|  1|  1| <br>|  1|  2| <br>|  1|  3|<br>+---+---+ <br>&gt;&gt;&gt; df_grouped=df.groupBy(&quot;_1&quot;).count()  <br>&gt;&gt;&gt; # groupBy needs to know by which function to aggregate the data by, thus the .count() <br>&gt;&gt;&gt; df_grouped.show() <br>+---+-----+ <br>| _1|count| <br>+---+-----+ <br>|  1|  100| <br>+---+-----+ <br>&gt;&gt;&gt; df_grouped.rdd.getNumPartitions() <br>200</pre><p>As you can see the partition number suddenly increases. This is due to the fact that the Spark SQL module contains the following default configuration: spark.sql.shuffle.partitions set to 200.</p><p>Depending on your use case, this can be benefitial or harmfull. In this particular case, one can see that the data volume is not enough to fill all the partitions when there are 200 of them, which causes unnecessary map reduce operations, and ultimately causes the creation of very small files in HDFS, which is not desirable. If however you have too little partitions, and lots of data to process, each of your executors memory might not be enough/available to process so much at one given time, causing errors like this java.lang.OutOfMemoryError: Java heap space . Remember that each partition is a unit of processing in Spark.</p><p>So to conclude: take a look at your application with care and figure out what your ideal partition number is. Working with dataframes usually brings more optimizations, but don’t forget to set the spark.sql.shuffle.partitions configuration to a value that suits your use case.</p><p>Smaller one this time, but hopefully it can help you somehow!</p><p>Please give your opinions and suggestions bellow!</p><p>Manuel Duarte Vilarinho Mourato @ Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28d05fdcb6fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Kudu: A baby with potential]]></title>
            <link>https://medium.com/@manuelmourato25/apache-kudu-a-baby-with-potential-f6742008adae?source=rss-92315a802bf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6742008adae</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[apache-kudu]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Manuel Mourato]]></dc:creator>
            <pubDate>Wed, 07 Feb 2018 18:09:33 GMT</pubDate>
            <atom:updated>2018-03-07T18:30:44.444Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*vFl8oWgHPmI_kLWc.jpg" /></figure><h4>Kudu’s place in the Hadoop ecosystem</h4><p>This image will probably look familiar if you have seen any (and I do mean ANY) talk about Apache Kudu, and in many respects it isn’t wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*WrSHM9fUus7T7QJt.png" /></figure><p>I will now give an extremely brief overview on what these three frameworks are and how they differ. If you already know the basic concepts go to “The big downsides of Kudu” section.</p><p><strong>HDFS Overview</strong></p><p>If you are familiar with HDFS, you know it’s an “all or nothing” distributed file system, in which updates, which are so vital in SQL data warehouses, simply do not exist. You can view your tables as a hierarchy of files inside folders, inside some more folders, and so on.</p><p>Each folder can be what is called a partition, and this is the basic unit for record “updating” and deletion for your table. If you want to delete or update some record in your table, you need to recreate the whole partition where the file containing your record is.</p><p>Take the example of updating a user list (any slow changing dimension really), namely the status of Miss X from single to married.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*iktFzp-0-99BVKQu2A0MFQ.png" /></figure><p>Now in SQL you might do something as trivial as this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*JYafBoJsk7wwLPq1TdPxvw.png" /></figure><p>But with HDFS, you need to first drop the whole partition in which Miss X is (let’s say this table is partitioned by Country), and finally reinsert the data with the update you wanted. Now in this case, you would have to drop all the records with the partition value “France”, which could be a lot.</p><p>And so by using Apache Hive or Impala on top of HDFS, you get an SQL like syntax like so, for this example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*JT_z3uHJfp4faVOUPh9nyQ.png" /></figure><p>This is the compromise of HDFS: if you want to query great volumes of data, specially if you know how the partitioning is done so you only move the data you need (BigQuery users, do look out for this or it will cost you!) then it is a great option. For single record queries, fast inserts, deletions and updates...you’re going to have some problems.</p><p><strong>HBase Overview</strong></p><p>HBase is the complete opposite of HDFS when it comes to use cases and queries for which it is optimized…which is kind of ironic since HBase is built on top of HDFS.</p><p>HBase is a key value data store, optimized for single record collection and updating. While it does have the notion of tables, rows and columns, it is very different from an RDBMS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*qnWMMOf-jEpT61zznVE_AA.png" /></figure><p>While HDFS files can be queried with an SQL like syntax using Hive or Impala, HBase has its own syntax to retrieve records, and would require a complete redefinition of architecture and query scripts, if one had to migrate from an SQL warehouse to an HBase scenario.</p><p>If we go back to the user dim case discussed above, this is what an update query in HBase would look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*EbLz7fS4_ea_dNE5hTzqEg.png" /></figure><p>In this case we assume that each user has a single id, which serves as a row key.</p><p>But of course the downside is that scans are extremely slow, unlike HDFS.</p><p><strong>Kudu Overview</strong></p><p>Kudu as you might have guessed by now, came as an effort to bring the best of both worlds to the table: fast querying and updating of single records, while providing fairly good performance for long table scans to a lot of data.</p><p>SQL users will find a friendly concept here which in SQL they cannot live without: indexing.</p><p>In simple terms, Kudu is a filesystem completely separated from HDFS, but with an equivelent to partitions, called tablets. These tablets group records in a column oriented way, resorting to the use of a primary key to organize them inside each of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*E7C8Q9QQeyY-U3JzM0JsWg.png" /><figcaption>Tablets in Kudu’s UI</figcaption></figure><p>This is how Kudu responds to both query types mentioned before: if you want to get/update a single record, it is exactly like in typical SQL, just specify the primary key for that record and voilá, you get it extremely fast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*JYafBoJsk7wwLPq1TdPxvw.png" /></figure><p>If however you want a bigger volume of data, like a daily scan,no problem, you just have to make sure that your table is hashed by day, which means that Kudu will only have to search in one tablet for the records you want, which is also reasonably fast.</p><h4>The problem with Kudu: it’s still in it’s infancy</h4><p>Apache Kudu was announced by Cloudera in late 2015, has graduated from its beta release in late 2016 and is currently in version 1.6 .</p><p>This isn’t a long time in production, and it definitely shows. Right now, more than calling Kudu a “middle ground”, it feels a lot more like an island, with a very loose bridge between the other Hadoop components.</p><p>Here is a list of issues that Kudu brings, and that one should consider before adopting it for a data architecture</p><ul><li><strong>Only one index is supported: </strong>This can<strong> </strong>be a problem if you have a lot of diversified queries that aggregate data by different variables (by timestamp, user, vehicle, etc). This primary key cannot be changed after table creation</li><li><strong>Does not redistribute replicas of tablets automatically</strong>: if you add a new node to your cluster for example, Kudu will not redistribute the tablets so that the cluster nodes are balanced. You need to either recreate all your existing tables, or move the tablets manually to balance your cluster using the following command, which might be tedious work</li><li><strong>Does not support sqoop</strong> : If you want to migrate your SQL warehouse tables to Kudu, you first need to sqoop them to HDFS, and then use a tool like Apache Spark to migrate the data to Kudu.</li><li><strong>Dependent on Impala for querying: </strong>Impala uses MPP (massive paralel processing)to perform queries, which basically means that it uses all deamons to fetch and compute the data it needs, and stores results in memory. This is great if you need to perform a query that doesn’t take too long (has few computations or doesn’t move that much data). If however you have a daily or monthly ETL in which you have complex queries or massive inserts that demand deamons to be working for hours, if you have a deamon failure, the query stops and needs to be recomputed from the very beginning. This is a nightmare for meeting SLAs, a nightmare that does not happen with Apache Hive, which uses MapReduce to perform queries, and thus saves intermediate results into disk, making it much more reliable for these types of scenarios. Kudu’s current engine for querying is solely Impala, which may cause some issues for these use cases.</li><li><strong>Impala tables created with Kudu data cannot be truncated</strong></li><li><strong>Cannot add partitions dynamically unless they are ranged: </strong>At the time of table creation you have to specify how you want to partition your table (divide it in tablets) and you have three options to do so: hash partitioning,range partitioning or a combination of the two. The problem is that in a production scenario, your tables will keep on increasing in volume and eventually you will need to add more tablets to keep your performance up. This cannot be done if you use hash partitioning. Similarly, data consolidation is impossible using Kudu, unless you create a new, separate table and perform a full insert to it, which may take some time.</li><li><strong>Partitioning tuning is not deterministic: </strong>You will see this in practice in the next section, but basically, for the exact same setup and query, there are times in which the number of tablets impact on performance is misleading. For example, the performance for a give query can be better with 6 tablets rather<strong> </strong>than with 12, but 24 tablets can also be better than 12, which makes it confusing if you want to do some partition tuning.</li></ul><h4>Performance for standard queries</h4><p>We tested a number of queries with different types of partitioning and primary keys to analyse Kudu’s behavior in a production like scenario.</p><p>Since we needed space for several tables, we setup a 5 node Azure cluster (2 headnodes and 3 datanodes), in which the machines had the following characteristics:</p><ul><li><strong>VM Type</strong>: ES4</li><li><strong>Cores:</strong> 4</li><li><strong>RAM:</strong> 32GB</li></ul><p>For those who do not want to set up an Azure account, I would recommend using a Docker cluster like the one from <a href="https://medium.com/@manuelmourato25/building-a-single-host-dockerized-cloudera-pseudo-cluster-aka-getting-to-know-the-big-data-155287836658">my last post</a> (query performance should decrease by a factor of two)</p><p>Without getting into too much detail, our data was something like the example bellow, tables with variables and a timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*4u8LmFB1KxV19czl7JebbA.png" /></figure><p>For this test we used three types of queries that were useful for our use cases</p><ul><li>Count all records in each table</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*bb6vHgojwtldmfhC6-yuuA.png" /></figure><ul><li>Count while specifying variable values/ranges from all variables in the primary key</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*BxDty62UaO2-iZUT4FKjag.png" /></figure><ul><li>A complex join query with multiple ranges and computations</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*E_-ttvU6WmKs_1-a7xTzeA.png" /></figure><p>For the tables in question, we decided that for our use case range tables were unnecessary, since our record count will remain fairly constant for most of the time (older records are deleted as new ones come in). As such we tested these queries on three tables partitioned by hash, all with the same primary key but with the following partition differences:</p><ul><li>The first one contains 6 tablets and is hashed by variable 1 and 2</li><li>The second one contains 12 tablets with a multilevel hash by variable 2 and timestamp</li><li>The third one contains 12 tablets with a multilevel hash by variable 1+2 and timestamp</li></ul><p>With tables with around 2 billion records, these were the results we found (in seconds)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0JJiPTHQ5q9uHkT-d0i2A.png" /></figure><p>From the results we attained, it is clear that the overall query times are good for the volume of data in question, same for other queries we have tried. Scalability is also not a problem (we have added extra nodes and have seen that query time usually is reduced).</p><p>Overall queries in Kudu behave extremely well if we specify exactly which partitions and values should be fetched. With queries like count however, all Kudu tablets need to be scanned, which takes longer.</p><p>The issue of what in fact makes for a good partitioning strategy is still there.</p><h4>The takeaway: Use it anyway</h4><p>While it is true that Kudu still has a long way to go, the fact is it delivers what it promises, good performance for both OLTP and OLAP scenarios.</p><p>So yeah, give it a shot, it is worth it. Just be sure that you have the right use case for it and that you are willing to compromise some features that are a given in the “common” Hadoop ecosystem tools, but not in Kudu.</p><p>That’s all folks!</p><p>Please give your opinions and suggestions bellow!</p><p>Manuel Duarte Vilarinho Mourato @ Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6742008adae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Dockerized Cloudera Pseudo Cluster, aka testing the Big Data ecosystem when you have no…]]></title>
            <link>https://medium.com/@manuelmourato25/building-a-single-host-dockerized-cloudera-pseudo-cluster-aka-getting-to-know-the-big-data-155287836658?source=rss-92315a802bf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/155287836658</guid>
            <category><![CDATA[cloudera]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Manuel Mourato]]></dc:creator>
            <pubDate>Tue, 23 Jan 2018 11:36:47 GMT</pubDate>
            <atom:updated>2018-01-23T11:41:06.522Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Dockerized Cloudera Pseudo Cluster, aka testing the Big Data ecosystem when you have no money</h3><p><strong>DISCLAIMER 1</strong>: Do not ever start your articles with a disclaimer.</p><p><strong>DISCLAIMER 2</strong>: This tutorial describes how to create a standard pseudo cluster using the Cloudera distribution, in order to provide a simple yet usefull way to learn about the current big data ecosystem, as well as to benchmark its frameworks and see how they adapt to your company business model or use case. That being said, I strongly advice<strong> not to use this in production</strong>, as it completely lacks fault tolerance do to running in a single host and is limited to how much you can vertically scale your machine, which goes against the horizontal scaling paradigm that most Big Data frameworks are designed for.</p><p><strong>DISCLAIMER 3</strong>: What follows is a detailed description of the steps I took to create and configure this pseudo cluster…most people have a lot more important stuff to do than to read through all that. As such, you can find a more direct step by step guide in the<strong> </strong><a href="https://github.com/ManuelMourato25/pseudo_cloudera_docker_cluster"><strong>Github project</strong></a> I created for this.</p><p><strong>LAST DISCLAIMER</strong>: Every step here was run in <strong>Red Hat Enterprise Linux</strong>, specifically with a <strong>Centos OS</strong>. I imagine that it will be similar for Windows and other OSs, but I cannot guarantee that there won’t be one or two extra steps in that case.</p><p>So with that out of the way, let’s dive right into creating your very own Big Data Cluster!</p><h3><strong>Hardware Requirements</strong></h3><p>First thing’s first, you need a machine. It can be your own personal computer or some machine you have lying around your office, just make sure it has the following minimum characteristics, otherwise you might have disk/memory “complaints” from your cluster:</p><ul><li>RAM Disk: 32GB (maybe 16GB if you only want to test a few services)</li><li>HDD: 1 TB</li><li>CPUs: 6</li></ul><p>The cluster in question can have any number of nodes, but in this use case I gave it four:</p><ul><li>One head node for metadata storage and overall resource management and process coordination in the cluster.</li><li>Three data nodes for actual data processing.</li></ul><h3>Installing Docker</h3><p>These nodes are no more than 4 docker containers connected to each other inside a network, and as such next you will need to install <strong>docker</strong> and <strong>docker-compose</strong> in your computer. (don’t know much about docker? I’ll leave some links at the end to get you started, it’s awesome, trust me!)</p><p>By default each of your containers can only occupy a maximum of 10 GB of space. Since this can complicate things, as there are contents that cannot be stored in volumes, one thing I highly recommend is to change the default container size to 20GB and the storage pool size limit to 200 GB by running these commands (stop the docker service first and backup any images you have!)</p><pre>$ service docker-service stop<br>$ dd if=/dev/zero of=/var/lib/docker/devicemapper/devicemapper/data bs=1G count=0 seek=200</pre><pre># Create the following file if it does not exist<br>$ touch /etc/docker/daemon.json</pre><pre># Insert the following into the file: <br>{<br>  &quot;storage-driver&quot;: &quot;devicemapper&quot;<br>}</pre><pre><br>$ dockerd --storage-opt dm.basesize=20G<br># After running this command do Ctrl+C</pre><pre>$ service docker start<br># Check docker info to see if the sizes have changed<br>$ docker info</pre><p>This will give you what you need to start the docker service.</p><h3>Getting the Dockerfiles that will create your pseudo cluster</h3><p>Just do a git clone, done .</p><pre>$ git clone https://github.com/ManuelMourato25/pseudo_cloudera_docker_cluster.git</pre><p>Once you get the project in your pc, just run the following</p><pre># Go inside the Cloudera_Cluster_Dockers directory<br>$ cp DockerComposeFiles_First_Use/docker-compose.yml .<br>$ ./build.sh</pre><p>And now you play the waiting game…takes about 20 minutes or so to build the images for all the containers you’re going to use.</p><p>Once the waiting is done, run this script, and you will end up with four lovely cluster nodes, within the same network, and with the Cloudera server running in the headnode.</p><pre>$ ./up.sh</pre><p>Give it around 10 minutes and go to localhost:7180, you should see something like this (default credentials are admin:admin)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14TxhtSACKVYYRmT9o27CA.png" /></figure><p>Be sure to replace the docker-compose.yml file you used this time by the one for regular use:</p><pre># Go inside the Cloudera_Cluster_Dockers directory<br>$ cp DockerComposeFiles_Regular_Use/docker-compose.yml .</pre><p>And that’s it for the setup! Let’s finally move on and create the actual cluster!</p><h3>Cluster Installation and Configuration</h3><h4>Selecting your hosts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYM8dWEsXTqn8Tc4XKNtpQ.png" /></figure><p>Nothing too complex here, just follow the setup instructions and select Cloudera Express as the package (it’s free), and you will get to the select hosts section . You have a four node cluster, each node has a hostname, and you need to tell Cloudera what those names are. You can change the node names to whatever you like, but for this case you just have to type: New Search -&gt; namenode1,datanode[1–3]</p><p>A list of all the nodes should show up, just select them and click next.</p><h4>Installing CHD parcels,Cloudera Agent and JDK</h4><p><strong>CHD parcels</strong></p><p>With your hosts now being part of a single cluster, it is now time to give them the Hadoop related services we need. The CDH parcel provides such a platform, with tools ranging from HDFS to Kudu and Spark. CDH is installed in each cluster node automatically but it does take a while.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YoWbCsIW8nXP4hgm7LFnOw.png" /></figure><p>In this step you will be asked if you want to install extra parcels besides CDH, like Kudu or Kafka. You are free to install Kafka, but do not install Kudu, as CDH-5.13 already has a newer Kudu version inside it.</p><p>I would also suggest not to install in Single User Mode, as that will require additional configurations.</p><p><strong>JDK</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*O91Nd1CSTQVIjstxyFfqag.png" /></figure><p>Java is the pillar of Hadoop based services, so we need to install it, which is basically just pressing the install JDK button when the option pops up. Regretfully Cloudera still installs JDK 7, which doesn’t allow you to run specific services like Spark2 since you need JDK 8 to do so. But it does work for Spark 1.x versions, so it’s okay for test purposes. Just modify the dockerfiles a bit if you really want JDK 8 on all nodes. You can specify the JAVA_HOME directory in the Cloudera Manager configurations later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*5I39qkQLL5MVc8ezOGJxkQ.png" /></figure><p>After that you will be asked for a global password for the root user of all the cluster machines, which again is admin, in order to install cloudera agent and JDK on all of them. Just press continue and the installation will start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VikvLEZ1F23zBblKSlusqg.png" /></figure><p><strong>DEBUG TIP 1:</strong> This installation step can sometimes fail the first time. Just rerun the failed nodes again and it will work.</p><h4>Download, Distribute and Activate CDH</h4><p>Here you just sit and relax while Cloudera installs and distributes all parcels, which may take a while. Mind the debug tips bellow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*GOTnH-i_62F1ZGeHBHW-Bg.png" /></figure><p><strong>DEBUG TIP 2:</strong> The key to solve errors in this step is to restart the cloudera agent in the failed nodes. Simply run these commands in your machine in case one or more nodes fail to install the parcel:</p><pre>$ sudo docker exec -it &lt;NODE_NAME&gt; /bin/bash<br># YOU ARE NOW INSIDE THE CONTAINER!<br>$ sudo rm -r /opt/cloudera/parcels/.flood/<br>$ service cloudera-scm-agent restart<br>$ exit</pre><p>You can now go back to the UI, and the installation should have restarted for that node.</p><h4>Selecting your packages</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEgvV1U9rmXpDqNnXTErkw.png" /></figure><p>Not much to say here, just select a “service package” that you want to test out, or if you are like me and want to dive into all of them, just click Custom and select all the services you want.</p><h4>Assign roles to your hosts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*takOUkNoFVqTVCEHGrEwvA.png" /></figure><p>So here is where you need to have a bit more of an insight on how each individual service works. Basically each service, like HDFS, has multiple roles that have to be carried out by your cluster nodes, thus the distinction between headnodes and datanodes. For example, in HDFS we have a Namenode where all the metadata about HDFS objects is stored, a Secondary namenode in order to safe guard our data in case of a failure, Datanodes where the actual files are stored, among other roles (some are necessary, some are not).</p><p>You will need to read some documentation, there is no avoiding it, but as a rule of thumb I will leave with some tips to make it faster:</p><ul><li>Whenever you see server in the description, it is usually a role for the cluster headnodes</li><li>Whenever you see gateway in the description, it is usually a role for edge nodes (or headnodes in this case)</li><li>Datanodes and NodeManagers are roles for datanodes</li><li>If you only have one headnode in your cluster, make it the secondary namenode as well as the namenode, in HDFS (do not leave it unassigned)</li><li>Usually assigning hosts to the NFS gateway in HDFS causes some issues, at least if you don’t want to configure your headnode for it, so just don’t assign any hosts to it for now</li></ul><h4>Setting service configurations (minimum)</h4><p>Some of the services require specific directories to be set before you can start using them, and this is what this step is for. Cloudera Manager will request that you specify the necessary folders and will even give suggestions if you click the help (“?”) button.</p><p>As with the previous step, I can only give you some suggestions, but it all depends on your use case (you can change these configs at any time)</p><ul><li>Make all your data,log and tmp related dirs start with /data/… (This is <strong>mandatory</strong>! It is a directory with a mount point to your outside machine)</li><li>Set 3 or more directories for namenode data directories (also <strong>mandatory</strong>, otherwise namenode formatting won’t be possible)</li><li>Set 3 directories for NodeManager Local directories</li></ul><h4>Selecting your database</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbC37aBIgKxz68QV1JneFA.png" /></figure><p>I’ve heard some people say a couple of times that the end of SQL based databases is inevitable with the coming of Big Data technologies such as these…this step proves them wrong for the time being.</p><p>There are certain services like Hive and Oozie which require an external database, to store vital metadata information about tables, jobs, partitioning, etc, and this is indeed an SQL database. If you want to simulate a real production scenario, I would advise you to start a new container with a PotgreSQL database fully dedicated for this purpose.</p><p>For this case, I chose to start a MySQL server inside the head node, and create all the databases I needed in there., so for this step you just need to insert the following:</p><ul><li>Database host name: <em>headnode1:3306</em></li><li>Database Type: <em>MySQL</em></li><li>Database Name: <em>metastore, amon, oozie and hue</em></li><li>Username: <em>root</em></li><li>Password:<em> admin</em></li></ul><p>Test the connections and you should be ready to go.</p><h4>A little detour…</h4><p>Before we move on (we’re almost done don’t worry) there is something we need to do manually before you press Next, which I could not include in the Dockerfiles, which is to create specific tables for the Hive Metastore Database. This is required for Hive to work, and all services that depend on it such as Spark</p><pre>$ sudo docker exec -it headnode1 /bin/bash</pre><pre># We are now inside the container!</pre><pre>$ sudo yum install mysql-connector-java<br>$ ln -s /usr/share/java/mysql-connector-java.jar /opt/cloudera/parcels/CDH-5.13.1-1.cdh5.13.1.p0.2/lib/hive/lib/mysql-connector-java.jar</pre><pre>$ mysql -u root -p -e &#39;SOURCE  /opt/cloudera/parcels/CDH-5.13.1-1.cdh5.13.1.p0.2/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-1.1.0.mysql.sql;&#39; metastore</pre><pre># You will be asked for the password, which is admin, and the script will run. That is all you need<br># You will get an error message but all the tables you need will be there</pre><pre>$ exit</pre><p>Go to where we left of in the Cloudera Manager UI, and let’s finally get the cluster services working!</p><h4>Starting up your services</h4><p>If all went well with the installation, you should now be seeing your services starting, a great accomplishment indeed…expect they will most likely fail (but that’s okay!).</p><p>When and if you get an error, click on “Cloudera Manager” on the top left corner and you will be taken to the CM’s homepage. There you can try and start some of the services manually, starting with the Cloudera Management Service down to the left, and then all the others.</p><p>When you are done, you will probably end up with something like the following image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhJK59BOnwvPjZEvMEHR7A.png" /></figure><p>But like I said it’s nothing to worry about, we just need to fix a couple of things:</p><ul><li><strong>Lack of Free Space Errors</strong>: The most common type of errors in this case are ones like “Heap Dump Directory is on a filesystem with less than …”. What you need to do to solve this, is to change all your data,logs and tmp related directories in each of the services configurations, to something like “/data/name_of_node/…”. Containers have a limited amount of space, and by using this /data volume, you are freeing up space that is needed for other purposes. Just go to a specific Service -&gt; Configurations and start replacing.</li><li><strong>HDFS Namenode is not formatted</strong>: If you have multiple namenode data directories, this error can be solved by simply going to HDFS-&gt;Instances, select the name node, Actions -&gt; Format Namenode.</li><li><strong>Directories missing errors:</strong> All services revolve around HDFS, and once it’s working properly there are some directories you need to create. Cloudera makes this super easy:</li></ul><p>HBase-&gt; Action-&gt;Create root dir</p><p>Spark-&gt; Action-&gt; Create History Server Directory</p><p>Hive-&gt; Action-&gt; Create Hive Warehouse Directory</p><p>Sqoop&gt; Action-&gt; Create Sqoop User Directory</p><p>If by any chance you get an error like: “<em>Permission denied: user=hive, access=WRITE”</em>, go inside your headnode docker container and run</p><pre>$ sudo -u hdfs hdfs dfs -chmod 777 /<br># or/and<br>$ sudo -u hdfs hdfs dfs -chmod 777 /user           <br></pre><p>I realize a <em>chmod 777</em> is tabu for some programmers and with good reason, but in this case all users need to access the root HDFS directory to create their individual directories.</p><h4>The most important step: Save your progress!!</h4><p>You know those old RPG games in which if you didn’t save at some checkpoint you would loose all your progress? Docker containers are pretty much the same.</p><p>The biggest downside of using docker containers is that, if the docker service goes down, you loose everything you changed inside it since the container was created (except for files inside volumes). In order to solve this issue, we need to save what we have done to the docker image we started with</p><pre># First get the running container list<br>$ sudo docker ps<br># Then get the existing images <br>$ sudo docker images<br># Finally run this for ALL hosts in your cluster<br>$ sudo docker commit &lt;CONTAINER_ID&gt; &lt;IMAGE_NAME&gt;<br># For example: sudo docker commit 117007b8464a datanode2_image<br># When the images are commited, run:<br>$ cp DockerComposeFiles_Regular_Use/docker-compose.yml .</pre><p>Images persist even if for example your pc shuts down, so all of your changes to the cluster will be saved. You might want to take this opportunity to create users in all containers for example, or change a few configurations, etc.</p><p>This first commit takes about 20 minutes, but subsequent commits take only a few seconds. Again “docker commit” isn’t that well accepted by the docker community (the “docker way” uses Dockerfiles) but in this case I did not see an alternative.</p><p><strong>DEBUG TIP 3</strong>: When you restart the dockers after you saved the images as described above, you might need to manually restart Cloudera Server inside the headnode, like so</p><pre>$ sudo docker exec -it headnode1 /bin/bash<br>$ service  sudo service cloudera-scm-server restart<br># Check the server status<br>$ service  sudo service cloudera-scm-server status</pre><h3><strong>And that’s it</strong></h3><p>If you followed all the steps correctly, you should have ended up with something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJ6cuGv9sGHWM5UbMYyPkw.png" /></figure><p>If you get warnings like “Parcel directory has less than 10 GB available”, change the Cloudera Manager alarm thresholds.</p><p>And that’s the end for this guide. Of course as any Big Data professional would tell you, this is only the beginning, as there are tons more configurations to tune, and create the perfect setup for your use case.</p><p>I do hope you found this tutorial useful though, it’s something I felt was missing for a long time, and this was an attempt to fill that gap.</p><p>Please give your opinion and suggestions for improvements!</p><p>Manuel Duarte Vilarinho Mourato @ Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155287836658" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>