<?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 Upstream on Medium]]></title>
        <description><![CDATA[Stories by Upstream on Medium]]></description>
        <link>https://medium.com/@upstreamsystems?source=rss-c428ab36f3eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ac65bPepRbGL44dcfXs7Zw.png</url>
            <title>Stories by Upstream on Medium</title>
            <link>https://medium.com/@upstreamsystems?source=rss-c428ab36f3eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:54:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@upstreamsystems/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[Jump Start Your Career as a Software Developer]]></title>
            <link>https://medium.com/upstream-engineering/jump-start-your-career-as-a-software-developer-59e7bb41bf06?source=rss-c428ab36f3eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/59e7bb41bf06</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[paid-internship]]></category>
            <category><![CDATA[training]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[upstream]]></category>
            <dc:creator><![CDATA[Upstream]]></dc:creator>
            <pubDate>Thu, 30 Sep 2021 11:36:12 GMT</pubDate>
            <atom:updated>2021-09-30T11:37:36.392Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get paid for real-world, hands-on experience with mentoring as part of our “<a href="https://www.upstreamsystems.com/start-at-upstream/">Start at Upstream</a>” graduate program</h4><p><em>by Nazaret Kazarian</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlHCZ4cbm2MC9UuacPWFnQ.jpeg" /></figure><p>When you study computer science, software engineering or related tech disciplines you hear all about the job opportunities awaiting. Probably even before that, this was a crucial factor in choosing what you want to study. Now you finally have your degree. Congratulations are in order.</p><p>What’s next though? How do you get your foot in the door?</p><p>“<a href="https://www.upstreamsystems.com/start-at-upstream/">Start at Upstream</a>” may be the ideal entry. Our 12-month paid internship program gives new graduates professional experience to jump start their career. To give you a glimpse on what is to follow on this learning journey, here’s how the first run of the program unfolded.</p><h3>The hiring process</h3><p>July 2019, Upstream’s engineers have developed a comprehensive trainee program for software developers, designed to transform graduates into seasoned, highly skilled pros through rigorous training and mentoring. It all starts with the candidates submitting their applications and then receiving a phone call from a member of our HR team, who explains the evaluation process and the technical test.</p><blockquote>“I knew Upstream by reputation, so when I heard about the program I had to apply. When I received the first call from them, I was really excited.”</blockquote><blockquote>George Zindros</blockquote><p>Next, the candidates hit the ground running, as they join a group tour of Upstream headquarters, so they can see the work environment. The HR presents the company and the program to them, while they perform the first round of technical and numerical tests and have their one on one interviews with the engineering team leads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SWQUDUx8ArdPs3x34D1U7w.jpeg" /></figure><h3>See what we do and show what you know</h3><p>Twenty-five candidates are then shortlisted to participate in a full-day event, where they’re divided into five teams, each with a lead, to work on a development task that simulates the way Upstream engineers work in their everyday tasks. Candidates will act both as team members, where they will build and demonstrate their teamwork skills, and as individuals, coding and delivering a solution on their own.</p><p>Team leads prepare an exercise that’s as close as possible to the real-world tasks, requirements and limitations that Upstream engineers deal with on a daily basis. It includes a build environment and unit tests for four different programming languages that reflect different backgrounds of the candidates.</p><p>Team leads test and calibrate the exercise’s difficulty by simulating the process a few times with volunteer Upstream engineers. The exercise starts with a teamwork phase, where each team brainstorms the solution design, followed by the implementation phase, where candidates have two hours to implement the solution on their own.</p><blockquote>“I enjoyed every part of the selection process. Every test, assessment and activity was both challenging and fun making it an experience to remember”.</blockquote><blockquote>George Tsompanelis</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjOZk9sORIcWq9hGfM-DRw.jpeg" /></figure><h3>The bootcamp</h3><p>The hiring process concludes with a meeting where all the team leads choose 10 out of the 25 candidates. Those new hires start a 40-day intensive training schedule covering a wide variety of software development topics, including Java basics and advanced Java multithreading, asynchronous programming, Spring and JPA. Each day is filled with in-depth presentations by team leads and architects, with live coding sessions. Practice exercises build upon the previous ones to incorporate the new concepts and technologies. Optional algorithmic exercises enable trainees to practice their analytical thinking skills.</p><blockquote>“These two months were like being back to university but on steroids. Never before have I learned so much on such a short while. I don’t think there’s a similar training program out there. People would pay a lot for such a kind of training!”</blockquote><blockquote>Timos Polemitis</blockquote><p>Throughout the program, each trainee has a personal mentor, who provides guidance about company processes and explains real-life scenarios for applying what they’ve learned. Mentors continue to be available to trainees long after they finish the 2-month bootcamp.</p><blockquote>“At any time you can reach out to your own mentor for feedback and advice. As you learn how to be a part of the team and apply all you have learned in practice it is reassuring to have a head figure with the skill and will to back you up every step of the way. “</blockquote><blockquote>Filippos Papaspyrou</blockquote><h3>Hands-on, real-world experience</h3><p>After graduating the bootcamp, trainees are allocated to Upstream’s software development teams. Induction is very gradual because they have to learn a large existing code base, but they soon become productive and participate in the product development just like veteran team members. After a few months, they rotate in different development teams to get hands-on experience with multiple products.</p><p>At the end of the program, 70% of the trainees became regular company employees and are still invaluable members of Upstream’s software engineering teams. All of them however acquired real-world work experience to make their CVs stand out and open doors around the IT industry.</p><p>Does all that sound like an experience you would like to live too? Get ready to jump start your career! Visit <a href="http://www.startatupstream.com/">www.startatupstream.com</a> to submit your application now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59e7bb41bf06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upstream-engineering/jump-start-your-career-as-a-software-developer-59e7bb41bf06">Jump Start Your Career as a Software Developer</a> was originally published in <a href="https://medium.com/upstream-engineering">Upstream Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Ehcache on Kubernetes]]></title>
            <link>https://medium.com/upstream-engineering/distributed-ehcache-on-kubernetes-3887516b1cc4?source=rss-c428ab36f3eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/3887516b1cc4</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[ehcache]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Upstream]]></dc:creator>
            <pubDate>Wed, 12 May 2021 15:12:17 GMT</pubDate>
            <atom:updated>2021-05-12T15:12:17.155Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Written by Dimitris Koukis</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*yBfJVulssFo6MtXsfBb9JQ.png" /></figure><h3>Introduction</h3><p>Traditionally, in Upstream we use Ehcache as a second level cache of Hibernate for all our java based projects. There are multiple reasons for this but mainly it is the simplicity of configuration (even in a clustered environment) and the performance of this solution, as well as the fact that when we took that decision there were not many alternatives to consider. Apart from the second level cache, we also use Ehcache for application level caching requirements, taking advantage of its distributed capabilities, using it as a synchronization method between the various application nodes in our cluster. Together with the application we also include a set of endpoints to inspect and reset the cache (for troubleshooting and investigation tasks)</p><p>Our configuration is relatively simple, we define a series of cache regions for the Hibernate second level cache and also extra regions for any ad-hoc caching requirements. We use the RMI based factories to enable the cache replication over the cluster, meaning all Ehcache nodes in the cluster communicate with each other using <a href="https://en.wikipedia.org/wiki/Java_remote_method_invocation">RMI</a>. Nodes in the cluster are called peers and communication between them happens using a CacheManagerPeerListener. The way Ehcache figures out which nodes are part of the cluster is with an EhcachePeerProvider. Here is an example configuration:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/378ab979558a5c2cb887e0455b746bae/href">https://medium.com/media/378ab979558a5c2cb887e0455b746bae/href</a></iframe><h3>Kubrnetes Era</h3><p>When we moved to Kubernetes as our production environment, we faced a serious problem: Ehcache relies on network multicast functionality to dynamically discover the application nodes in the cluster. Enabling multicast was not an option in our Kubernetes installation due to the fact that we use Calico as the network service, which currently does not support multicast (it is on the roadmap but not yet implemented). Therefore we had to search for a different approach, performing the discovery of the nodes at the application level rather than rely on the network.</p><p>The other solution was to move to a different cache provider that had native support for Kubernetes environments at that time (e.g. Hazelcast). Products that were developed at that time within the company followed that approach. In the case of existing products however, that would mean that we would have to change the Hibernate configuration and modify deployment scripts, but even worse we had to change the application itself where Ehcache was used as an ad-hoc distributed cache. Therefore, for our existing products we decided to tackle the peer discovery problem without relying on multicast.</p><h3>Solution overview</h3><p>The idea was to create a custom Ehcache CacheManagerPeerProvider. As mentioned above, we use RMI for cache replication, meaning peers communicate with each other using RMI. So what we needed was a custom implementation of an RMICacheManagerPeerProvider. Ehcache provides two implementations out of the box: the ManualRMICacheManagerPeerProvider, where the list of peers is provided statically (as configuration) and the MulticastRMICacheManagerPeerProvider, where the list of peers is updated dynamically using multicast. We created another implementation which would dynamically discover peers through a different channel rather than the network. Since all nodes share the same application database, our thought was that during initialization, the network address of the node will be stored in a database table which would periodically be read so that we have a complete and updated list of the application nodes. Then our custom peer provider would discover the cluster nodes using this table.</p><h3>Implementation</h3><p>The implementation consists of two sections. The first section isn&#39;t tied to Ehcache at all. Its main class is ClusterNodeManager which is responsible to keep track of the available application nodes in the cluster as well as to notify any interested components for any changes in the cluster state using the <em>Observer</em> pattern. For this reason we have created the ClusterNodeListener interface, which must be implemented by observer components. Keeping the list of nodes up to date is achieved by periodically reading and writing to the database utilizing two schedulers. The first one, writes the state of the current node in the database. Apart from updating its own state, it also removes any stale records from the database, based on the record timestamp. This way, if a node fails to unregister itself while shutting down, it will be removed from the cluster after a while due to inactivity.</p><p>The second scheduler reads the database and in case the list of nodes has changed (a new node has been added or a node has been removed) since the last read, it updates the internal state of ClusterNodeManager (the list of available nodes in the cluster). It then asynchronously notifies all <em>observers</em> for that change, making them aware of the updated node list.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/933c113803341d81964af6d36bfebdee/href">https://medium.com/media/933c113803341d81964af6d36bfebdee/href</a></iframe><p>The second section of the implementation is the Ehcache extension. In order to make Ehcache aware of the cluster updates, we created a custom peer provider by extending the RMI peer provider implementation of Ehcache (RMICacheManagerPeerProvider), similarly to the existing Manual and Multicast implementations, which also extend RMICacheManagerPeerProvider. Our implementation is called DatabaseRMICacheManagerPeerProvider, as peer discovery is achieved using the nodes list we have from the ClusterNodeManager. More specifically, DatabaseRMICacheManagerPeerProvider acts as an <em>observer</em> of the ClusterNodeManager (implements the ClusterNodeListener interface). Therefore, upon a change in the available nodes the onClusterNodeChange() method is called which updates the internal list of peerUrls in the peer provider. For each available node, we call registerPeer() for each cache associated with this peer provider, adding the new URL in peerUrls. We have implemented the abstract registerPeer() method to add the node to the peerUrls list, similar to the existing Manual and Multicast implementations. Then we have also implemented the abstract listRemoteCachePeers() method, to return the available peers based on these data. We also perform a liveness check for the remote peers before adding or returning them (using the existing lookupRemoteCachePeer() method).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0b20726c277bf910f1f316042ea22ea/href">https://medium.com/media/c0b20726c277bf910f1f316042ea22ea/href</a></iframe><p>To put the two pieces of the implementation together, upon application initialization, we identify all configured peer providers from the various Ehcache regions and register them to ClusterNodeManager in order to receive the cluster state updates.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d75da5bf8fc8694bbd2af55512f3bcc/href">https://medium.com/media/1d75da5bf8fc8694bbd2af55512f3bcc/href</a></iframe><p>Finally we have a peer provider factory that creates the new custom peer provider. This implementation is used to define the cacheManagerPeerProviderFactory in Ehcache configuration, replacing the out-of-the-box Ehcache peer provider factory that we had.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d7018975733ff395d7575f20aaf7db3/href">https://medium.com/media/9d7018975733ff395d7575f20aaf7db3/href</a></iframe><p>There are no further configuration changes required, making the upgrade process rather easy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/020b5f4c06d0921169abf19b28b444b4/href">https://medium.com/media/020b5f4c06d0921169abf19b28b444b4/href</a></iframe><h3>Integration with applications</h3><p>We bundled our solution as an independent library, containing the functionality of the new peer provider and dependencies. In our applications that use the library, we use Spring framework to inject the required resources to the library. That would include the datasource to access the database table as well as other configurations like node idle time, read/write interval etc. This makes our solution database independent and we were able to use it against various implementations (Postgres, Cassandra and Redis), depending on the available database of the module.</p><h3>Roll out</h3><p>The solution worked like a charm in all products that used it. We didn’t notice any problem related to performance or loss of data despite the fact that we were in a high traffic environment but also dynamic, meaning that we often had nodes added/deleted based on the traffic as well as frequent rolling deployments.</p><h3>Data integrity bug</h3><p>We came across a major issue about two years after our first roll out. Our applications have multiple installations, each one with unique configuration and data. A typical installation would include at least two nodes for availability reasons which would scale up based on the incoming traffic.</p><p>While investigating a bug, we found out that the contents of the cache of an application node were not the expected compared to the application configuration but rather contained configuration entries that belonged to a different installation. Our investigation concluded that this was an edge case where an application node performed a forced shutdown without being able to run the clean up method that removed the application from the node list in the database. Before another node was able to remove this entry due to inactivity, a new application of a different installation was deployed and was assigned the same network address as the shutdown node. As a result, this node started receiving cache updates of a different installation. In order to fix it, we set the Ehcache RMI listener port (meaning the port of RMICacheManagerPeerListener) to a unique value per application installation, as well as per version of the application, so that if we ever come across the same situation, the Ehcache nodes will only communicate with peers of the same installation and version, as others would operate on a different port.</p><h3>Further improvements</h3><p>Since we have introduced Consul as our service discovery mechanism in Kubernetes, we are working on the direction of replacing the functionality that identifies the cluster nodes. Instead of reading and writing the IP addresses to a database, we use Consul services to discover the nodes belonging to the specific installation and use that list to populate the peerUrls of the peer provider. Upon any update in the nodes list, we update the cache using the same functionality as described above.</p><p>One more improvement would be the upgrade to Ehcache version. Our solution is based on version 2.x and in new versions (3.x) the clustering support has a totally different implementation. Most probable, the upgrade would require a major re-writing to use the new functionality.</p><h4>Acknowledgments</h4><p>This article is based on the work made by Nikos Kotzalas and Giannis Mitropoulos.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3887516b1cc4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upstream-engineering/distributed-ehcache-on-kubernetes-3887516b1cc4">Distributed Ehcache on Kubernetes</a> was originally published in <a href="https://medium.com/upstream-engineering">Upstream Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloudera Cluster Deployment Automation]]></title>
            <link>https://medium.com/upstream-engineering/cloudera-cluster-deployment-automation-82a987185f51?source=rss-c428ab36f3eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/82a987185f51</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloudera]]></category>
            <dc:creator><![CDATA[Upstream]]></dc:creator>
            <pubDate>Fri, 18 Dec 2020 18:22:08 GMT</pubDate>
            <atom:updated>2020-12-18T18:22:08.837Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Written by Fanis Korlos</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w1v8vvPIRib-3vrv" /><figcaption>Photo by <a href="https://unsplash.com/@tvick?utm_source=medium&amp;utm_medium=referral">Taylor Vick</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Big Data can be defined using the famous 3 Vs — <em>Volume</em>, <em>Velocity</em> and <em>Variety.</em> One could think that such a notion would be of interest only to global behemoths, the likes of Google and Amazon. Nevertheless, during the last 10 years that we have experienced an unprecedented boom in software startups, many smaller to medium-sized companies have come to realize the merits of crunching the data they produce. Such a practice can lead to enhanced user experience, faster troubleshooting, and better decision making overall.</p><p>At Upstream we have chosen some well established open-source Apache-licensed platforms such as <em>Hadoop</em>, <em>Spark</em> and <em>Kafka</em> in order to handle the events that our applications produce. As part of our effort to evaluate various reliable engines for SQL processing over data stored in HDFS, we decided to try the <em>Impala</em> query engine.</p><p>Since the existing documentation regarding the installation process of the Apache-licensed <em>Impala</em> daemons was quite limited, we chose to install it using the version shipped by <em>Cloudera</em>.</p><h3>Cloudera to the rescue</h3><p>Cloudera is a US-based company which offers <strong>CDH </strong><em>(Cloudera Distributed Hadoop), </em>an open-source platform distribution. At the heart of <strong>CDH</strong> lies <strong>Cloudera Manager</strong> which allows managing CDH clusters end-to-end, and is comprised of the following main components:</p><ul><li><strong>Cloudera Manager Server: </strong>An application that includes an Admin Console Web UI as well as an API and is responsible for installing, configuring and managing the cluster on which Big Data services run.</li><li><strong>Cloudera Manager Agent: </strong>An application that is installed in each host of the cluster responsible for monitoring the host and managing the running services based on the instructions of the Server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/0*JbPKSVFUNgCPHtqP" /></figure><h3>Setting up a Cloudera Manager Cluster</h3><p>The process of installing a Cloudera Manager Cluster consists of two steps:</p><ol><li>The first one has to do with the installation of the Cloudera Manager Server and Agent services to our hosts. At Upstream we use the <em>Ansible orchestration</em> tool for OS-provisioning and software installation, hence it was the obvious choice for the implementation of this step.</li><li>The second one has to do with the Big Data services installation (<em>Hadoop, Spark, Impala</em> etc.) via the Cloudera Manager Server. The easiest and best documented way for this is via the Cloudera Manager Server Web UI, a wizard-like intuitive interface that allows the user to select which service will be installed to which host, and perform the required configuration.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*66s527_2vwNluarf" /></figure><p>But what if apart from our main production cluster, we need to set up a second one for new feature testing, or a third one for performance testing? What if we need to spin-up a whole short-lived cluster just to look into the feasibility of a new idea? In such a case, the administrator has to manually repeat the tedious task of applying the required settings via the UI, adjusting them every time to the needs of the specific cluster.</p><p>That is where the <em>Cloudera Manager API</em> comes in handy. Since the step-by-step process of creating a Cloudera Cluster via the API is not clearly documented, and the API offers an overwhelming amount of options, we decided to investigate how to utilize it in order to produce a fully automated deployment procedure.</p><h3>Utilizing the Cloudera Manager API</h3><p>In order to showcase our approach of utilizing the API, we will provide an example of setting up an HDFS service that spans across three hosts, one NameNode and two DataNodes, by following discrete and intuitive steps.</p><p>We make the assumption that the hosts used in our demonstration have been setup with FQDNs host-master-fqdn, host-slave1-fqdn and host-slave2-fqdn respectively. As a prerequisite step, Cloudera Manager Agent service has been installed to all three of them, and a Cloudera Manager Server instance is running on host host-master-fqdn. Finally, the <em>parcel</em> including the software versions of the components we need to install has been successfully distributed and activated. A <a href="https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_ig_parcels.html"><em>parcel</em></a> is a Cloudera specific binary distribution format containing the program files, along with additional metadata used by Cloudera Manager. Cloudera Manager Server by default utilizes port 7180, which provides access to both the Web UI and the Rest API. All the following commands are issued on host host-master-fqdn. Note that the output of the issued commands corresponds to Cloudera API version 6.3.0. [<a href="https://archive.cloudera.com/cm6/6.3.0/generic/jar/cm_api/apidocs/tutorial.html">API Ref</a>]</p><p>At first we retrieve the API version, which is a prerequisite for the API calls to follow:</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/version</pre><pre>v33</pre><p>Cloudera Manager by default assigns a hostId uuid value to each host that runs the Cloudera Agent daemon and sends a heartbeat to the Cloudera Manager Server (abridged output to only depict the fields of interest):</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/v33/hosts</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;hostId&quot; : &quot;e7e98d00-e7d1-4ab9-a2be-5716e30c1346&quot;,<br>    &quot;hostname&quot; : &quot;host-master-fqdn&quot;<br>  }, {<br>    &quot;hostId&quot; : &quot;33376508-c3d8-452f-a0f9-f50f770c2bea&quot;,<br>    &quot;hostname&quot; : &quot;host-slave1-fqdn&quot;<br>  }, {<br>    &quot;hostId&quot; : &quot;412f8599-f5f4-4193-b454-5f42506011e6&quot;,<br>    &quot;hostname&quot; : &quot;host-slave2-fqdn&quot;<br>  }]<br>}</pre><p>This hostId to FQDN mapping will come handy in various subsequent API calls, since Cloudera Manager recognizes hosts by their hostId.</p><p>A Cloudera Manager installation can orchestrate multiple clusters, but we use the convention of one cluster per installation to keep things simple. In order to add a new cluster named <em>upstream</em>:</p><pre>$ curl -XPOST -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-cluster http://localhost:7180/api/v33/clusters</pre><pre><br>$ cat cm-cluster</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;upstream&quot;,<br>    &quot;version&quot; : &quot;CDH6&quot;,<br>    &quot;fullVersion&quot; : &quot;6.3.0&quot;<br>  } ]<br>}</pre><p>We add our hosts to the newly created cluster using the hostId values that were retrieved from a previous step:</p><pre>$ curl -XPOST -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-cluster-hosts http://localhost:7180/api/v33/clusters/upstream/hosts</pre><pre>$ cat cm-cluster-hosts</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;hostId&quot; : &quot;e7e98d00-e7d1-4ab9-a2be-5716e30c1346&quot;<br>  }, {<br>    &quot;hostId&quot; : &quot;33376508-c3d8-452f-a0f9-f50f770c2bea&quot;<br>  }, {<br>    &quot;hostId&quot; : &quot;412f8599-f5f4-4193-b454-5f42506011e6&quot;<br>  } ]<br>}</pre><p>The next step is to check the serviceTypes that our CDH cluster supports (output might differ based on CDH and parcels versions):</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/v33/clusters/upstream/serviceTypes</pre><pre>{<br>&quot;items&quot; : [ &quot;SOLR&quot;, &quot;ACCUMULO_C6&quot;, &quot;ADLS_CONNECTOR&quot;, &quot;LUNA_KMS&quot;, &quot;HBASE&quot;, &quot;SENTRY&quot;, &quot;HIVE&quot;, &quot;KUDU&quot;, &quot;HUE&quot;, &quot;FLUME&quot;, &quot;DATA_CONTEXT_CONNECTOR&quot;, &quot;SPARK_ON_YARN&quot;, &quot;THALES_KMS&quot;, &quot;HIVE_EXEC&quot;, &quot;HDFS&quot;, &quot;OOZIE&quot;, &quot;ISILON&quot;, &quot;SQOOP_CLIENT&quot;, &quot;KS_INDEXER&quot;, &quot;ZOOKEEPER&quot;, &quot;YARN&quot;, &quot;KMS&quot;, &quot;KEYTRUSTEE&quot;, &quot;KEYTRUSTEE_SERVER&quot;, &quot;KAFKA&quot;, &quot;IMPALA&quot;, &quot;AWS_S3&quot; ]<br>}</pre><p>In order to create the HDFS service the caller can pack all the relevant information (service configuration, roles, configuration groups) in one API call, but we choose to set up the service piecemeal to maintain simplicity and readability.</p><p>At first we enable the HDFS service in our cluster:</p><pre>$ curl -XPOST -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-service http://localhost:7180/api/v33/clusters/upstream/services</pre><pre>$ cat cm-service</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;hdfs&quot;,<br>    &quot;type&quot; : &quot;HDFS&quot;<br>  } ]<br>}</pre><p>Checking the available RoleTypes of our HDFS service will require the following call:</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleTypes</pre><pre>{<br>  &quot;items&quot; : [ &quot;DATANODE&quot;, &quot;NAMENODE&quot;, &quot;SECONDARYNAMENODE&quot;, &quot;BALANCER&quot;, &quot;GATEWAY&quot;, &quot;HTTPFS&quot;, &quot;FAILOVERCONTROLLER&quot;, &quot;JOURNALNODE&quot;, &quot;NFSGATEWAY&quot; ]<br>}</pre><p>Our purpose is to assign the role of NAMENODE to host host-master-fqdn<em>, </em>and the role of DATANODE to our slave hosts host-slave1-fqdn and host-slave2-fqdn<em>. </em>Once again we utilize the hostIds that we have already retrieved from a previous step. We define a name for each role that we assign, by convention one that includes the name of the service, the role and an indicative part of the host FQDN. If such a name is not provided in the API call, Cloudera Manager will automatically generate one.</p><pre>$ curl -XPOST -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-roles http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roles</pre><pre>$ cat cm-roles</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;hdfs-NAMENODE_master&quot;,<br>    &quot;type&quot; : &quot;NAMENODE&quot;,<br>    &quot;hostRef&quot; : {<br>      &quot;hostId&quot; : &quot;e7e98d00-e7d1-4ab9-a2be-5716e30c1346&quot;<br>    }<br>  }, {<br>    &quot;name&quot; : &quot;hdfs-DATANODE_slave1&quot;,<br>    &quot;type&quot; : &quot;DATANODE&quot;,<br>    &quot;hostRef&quot; : {<br>      &quot;hostId&quot; : &quot;33376508-c3d8-452f-a0f9-f50f770c2bea&quot;<br>    }<br>  }, {<br>    &quot;name&quot; : &quot;hdfs-DATANODE_slave2&quot;,<br>    &quot;type&quot; : &quot;DATANODE&quot;,<br>    &quot;hostRef&quot; : {<br>      &quot;hostId&quot; : &quot;412f8599-f5f4-4193-b454-5f42506011e6&quot;<br>    }<br>  } ]<br>}</pre><p>As a final step, we need to define the configuration that will be applied to our newly installed HDFS service.</p><p>Service configuration is separated into S<strong>ervice</strong>-wide and R<strong>oleType</strong>-wide configuration.</p><p>The distinction between the two lies in the fact that the former typically includes settings that affect multiple role types, such as <em>HDFS Replication Factor</em>, whereas the latter is a template that gets inherited by specific role instances, for example by each <em>Data Node</em>.</p><h4>Service-wide configuration</h4><p>As part of our example, we will update the value of the <em>HDFS Replication Factor</em> which is represented by the dfs_replication variable (it has a default value of 3):</p><pre>$ curl -XPUT -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-service-config http://localhost:7180/api/v33/clusters/upstream/services/hdfs/config</pre><pre>$ cat cm-service-config</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;dfs_replication&quot;,<br>    &quot;value&quot; : &quot;2&quot;<br>  } ]<br>}</pre><h4>RoleType-wide configuration</h4><p>Finally, we need to define the configuration that will be applied to each of our role types. For that purpose we make use of the roleConfigGroups resource of the API:</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleConfigGroups | jq &#39;.items[].name&#39;</pre><pre>&quot;hdfs-NAMENODE-BASE&quot;<br>&quot;hdfs-FAILOVERCONTROLLER-BASE&quot;<br>&quot;hdfs-SECONDARYNAMENODE-BASE&quot;<br>&quot;hdfs-DATANODE-BASE&quot;<br>&quot;hdfs-BALANCER-BASE&quot;<br>&quot;hdfs-GATEWAY-BASE&quot;<br>&quot;hdfs-JOURNALNODE-BASE&quot;<br>&quot;hdfs-HTTPFS-BASE&quot;<br>&quot;hdfs-NFSGATEWAY-BASE&quot;</pre><p>Cloudera Manager creates one roleConfigGroup per supported roleType using the naming convention &lt;service_name&gt;-&lt;RoleType&gt;-BASE. We can review the current value of our configured parameters (i.e. for NAMENODE):</p><pre>$ curl -XGET -u admin:admin http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleConfigGroups/hdfs-NAMENODE-BASE/config</pre><pre>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;dfs_namenode_servicerpc_address&quot;,<br>    &quot;value&quot; : &quot;8022&quot;,<br>    &quot;sensitive&quot; : false<br>  } ]<br>}</pre><p>The call reverts only parameters for which we have overridden the default value. In order to review the full list of supported parameters (which can include dozens or hundreds of items) along with a short description for each one, we can append the view=FULL query string to the URL (output omitted for obvious reasons):</p><pre>curl -XGET -u admin:admin http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleConfigGroups/hdfs-NAMENODE-BASE/config?view=FULL</pre><p>We notify the Cloudera Server of the desired configuration values for both the NAMENODE and DATANODE role types:</p><pre>$ curl -XPUT -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-nn-config http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleConfigGroups/hdfs-NAMENODE-BASE/config</pre><pre>$ cat cm-nn-config<br>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;dfs_name_dir_list&quot;,<br>    &quot;value&quot; : &quot;/data/hdfs/namenode&quot;<br>  }, {<br>    &quot;name&quot; : &quot;namenode_java_heapsize&quot;,<br>    &quot;value&quot; : &quot;1073741824&quot;<br>  } ]<br>}</pre><pre>$ curl -XPUT -u admin:admin -H &quot;content-type:application/json&quot; -d @cm-dn-config http://localhost:7180/api/v33/clusters/upstream/services/hdfs/roleConfigGroups/hdfs-DATANODE-BASE/config</pre><pre>$ cat cm-dn-config<br>{<br>  &quot;items&quot; : [ {<br>    &quot;name&quot; : &quot;dfs_data_dir_list&quot;,<br>    &quot;value&quot; : &quot;/data/hdfs/datanode&quot;<br>  }, {<br>    &quot;name&quot; : &quot;datanode_java_heapsize&quot;,<br>    &quot;value&quot; : &quot;1073741824&quot;<br>  } ]<br>}</pre><p>The above calls do not introduce new configuration to Cloudera Server, rather than simply override the existing default values, and that explains the HTTP <em>PUT</em> method used (in contrast to the <em>POST</em> method of the previous steps).</p><h3>Making the most of the API Functionality using Ansible</h3><p><em>Ansible</em> orchestration tool provides a vast collection of modules, which are standalone scripts that can interact with the local machine or a remote system to perform specific tasks. Modules can also interact with APIs, and it is customary for users to develop their own custom modules in order to handle such an interaction.</p><p>Since we chose <em>Ansible</em> to perform OS-level provisioning and <em>Cloudera</em> software installation, it was only normal for us to develop our own custom module to handle the communication with the <em>Cloudera Manager</em> API, and perform a fully automated configuration of <em>Cloudera </em>cluster and services.</p><p><em>Cloudera Manager 6.0 </em>introduces a Swagger-based Python API client named cm_client that is compatible with all CM API versions, and replaces the cm-api one that is now considered deprecated.</p><p>In order to avoid such external dependencies, and also obtain a deeper understanding of the API functionality, we developed our module using the ubiquitous python <a href="https://requests.readthedocs.io/en/master/"><em>requests</em></a> library, based on the steps of the previous section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*h31SFE5GWBND7Rtb" /></figure><p>The role of each host is declared in the INI-like static Ansible inventory file:</p><pre><strong>[hdfs-namenode]</strong><br>host-master-fqdn</pre><pre><strong>[hdfs-datanodes]</strong><br>host-slave1-fqdn<br>host-slave2-fqdn</pre><p>The configuration that was applied step by step in the previous section is assembled using the below yaml syntax:</p><pre><strong>name</strong>:    &#39;hdfs&#39;<br><strong>type</strong>:    &#39;HDFS&#39;<br><strong>cluster</strong>: &#39;upstream&#39;<br><strong>config</strong>: <br>  - name:  dfs_replication<br>    value: 2<br><strong>roles</strong>:<br>  - type:  namenode<br>    hosts: {{ groups[&#39;hdfs-namenode&#39;] }}<br>  - type:  datanode<br>    hosts: {{ groups[&#39;hdfs-datanodes&#39;] }}<br><strong>roleConfigGroups</strong>:<br>  namenode:<br>    - name:  dfs_name_dir_list<br>      value: &quot;/data/hdfs/namenode&quot;<br>    - name:  namenode_java_heapsize<br>      value: &quot;1073741824&quot;<br>  datanode:<br>    - name:  dfs_data_dir_list<br>      value: &quot;/data/hdfs/datanode&quot;<br>    - name:  datanode_java_heapsize<br>      value: &quot;1073741824&quot;</pre><p>Since some configuration parameters require different values per deployed cluster, we utilize <em>Jinja2</em> templating to enable dynamic access to variables:</p><pre>datanode:<br>    - name:  datanode_java_heapsize<br>      value: &quot;{{ datanode_heapsize_bytes }}&quot;</pre><p>As part of our <em>Ansible</em> tasks, we first create a local copy of the configuration yaml file where all dynamic variables have been replaced with the desired values using the <a href="https://docs.ansible.com/ansible/latest/modules/template_module.html">template</a> module:</p><pre>- name: Create Service configuration file from template<br>  template:<br>    src:  &#39;hdfs/config.yml.j2&#39;<br>    dest: &#39;/tmp/hdfs-config.yml&#39;<br>  delegate_to: localhost</pre><p>This file is then provided as input to our custom module, which interacts with the <em>Cloudera Manager API</em> to perform the requested setup:</p><pre>- name: Perform Cloudera Cluster setup (via the API)<br>  api_custom_module:<br>    conf_file: &#39;/tmp/hdfs-config.yml&#39;<br>  delegate_to: localhost</pre><h3>Next steps</h3><p>During the last few years <em>Kubernetes</em> has emerged as the de-facto standard workload scheduler in the cloud. At <em>Upstream</em> we are responding to the momentum behind it by deploying and managing our on-premises cluster, with the final purpose of transferring all our live applications to it, including our Big Data stack.</p><p><em>CDH</em> does not inherently support <em>Kubernetes</em> deployments, yet <em>Cloudera</em> recently announced the <em>CDP Private Cloud</em>, designed to work with <em>IBM RedHat’s OpenShift</em> Kubernetes-based private cloud environment.</p><p>Combining the ability of the Cloudera API to simplify complex and intertwining configuration between Big Data services, along with the efficiency of resource-management provided by Kubernetes is a prospect that we are eager to start exploring and implementing in our workloads.</p><h3>Conclusion</h3><p>Based on the process that we have developed, in order to deploy a new Cloudera cluster from scratch, all the administrator has to do is to define which role each host will undertake in the <em>Ansible </em>inventory file, as well as specify the values of the cluster specific configuration variables, such as the desired java heap size per process.</p><p>The custom <em>Ansible </em>module takes care of the communication with the <em>Cloudera Manager API</em>, giving us the ability to not only perform a very fast first time deployment, but also safely update configuration values for an existing cluster, and ensure consistency across all hosts’ and clusters’ configuration.</p><h3>References</h3><p><a href="https://cloudera.github.io/cm_api/docs/python-client-swagger/">https://cloudera.github.io/cm_api/docs/python-client-swagger/</a><br><a href="http://cloudera.github.io/cm_api/docs/quick-start/">http://cloudera.github.io/cm_api/docs/quick-start/</a><br><a href="https://github.com/cloudera/cm_api/blob/master/python/examples/auto-deploy/deploycloudera.py">https://github.com/cloudera/cm_api/blob/master/python/examples/auto-deploy/deploycloudera.py</a><br><a href="https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_intro_automation_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f17">https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_intro_automation_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f17</a><br><a href="https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_intro_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f20">https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_intro_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f20</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82a987185f51" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upstream-engineering/cloudera-cluster-deployment-automation-82a987185f51">Cloudera Cluster Deployment Automation</a> was originally published in <a href="https://medium.com/upstream-engineering">Upstream Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome to the Upstream Technology and Engineering blog]]></title>
            <link>https://medium.com/upstream-engineering/welcome-to-the-upstream-technology-and-engineering-blog-a40f3eefff07?source=rss-c428ab36f3eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a40f3eefff07</guid>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <dc:creator><![CDATA[Upstream]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 11:26:08 GMT</pubDate>
            <atom:updated>2020-10-30T11:26:08.297Z</atom:updated>
            <content:encoded><![CDATA[<h3>Upstream Technology and Engineering blog — Welcome</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jzXBwXHMaqiDVhW_zVCqwA.jpeg" /></figure><p>At Upstream we support service industries in achieving digital growth. We provide innovative solutions that address 1.2 billion consumers in high growth markets. The mobile operators and other companies partnering with us unlock new, digital, revenue streams while strengthening their core business offerings, drive conversions and reduce churn.</p><p>As a technology company we strive to be ahead of developments and swear by innovation. Our team of Engineers are the heart of what we do, solving problems and building solutions.</p><p>Here we will be sharing some of the work we are passionate about. Welcome to the <a href="https://medium.com/upstream-engineering">Upstream Technology and Engineering blog</a>!</p><figure><img alt="https://upstreamsystems.com/" src="https://cdn-images-1.medium.com/max/1024/1*HxpUUWX4GjLuhY0cF-87jQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a40f3eefff07" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upstream-engineering/welcome-to-the-upstream-technology-and-engineering-blog-a40f3eefff07">Welcome to the Upstream Technology and Engineering blog</a> was originally published in <a href="https://medium.com/upstream-engineering">Upstream Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>