<?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[Zaloni Engineering - Medium]]></title>
        <description><![CDATA[Get technical, actionable information on how to streamline your data pipelines and accelerate time to data value. Zaloni experts and guests highlight innovative wins and learnings. - Medium]]></description>
        <link>https://medium.com/zaloni-engineering?source=rss----ca51b078b7a9---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Zaloni Engineering - Medium</title>
            <link>https://medium.com/zaloni-engineering?source=rss----ca51b078b7a9---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:16:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/zaloni-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Create an AWS Lambda EC2 AutoStart Function]]></title>
            <link>https://medium.com/zaloni-engineering/how-to-create-an-aws-lambda-ec2-autostart-function-c0b22d5f8e5c?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/c0b22d5f8e5c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[amazon-ec2]]></category>
            <dc:creator><![CDATA[Matthew Caspento]]></dc:creator>
            <pubDate>Thu, 23 Jun 2022 13:35:46 GMT</pubDate>
            <atom:updated>2022-06-23T13:54:25.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*wk7vSfIS7G1dRXOHDKNDqQ.jpeg" /></figure><p>Automation is a wonderful thing, especially if you’re lazy and don’t want to spend more than 3 minutes doing something. In this case, I hated getting up early each morning to start my environment. So I decided to automate my morning.</p><h3><strong>Use Case:</strong></h3><p>The use case we’ll be covering in this blog is automating the start of environments in order to enable an engineer to start the work day without delay. When an engineer starts their day, they have to authenticate to AWS. Once authenticated they need to switch regions and roles to where the EC2 instance resides. Then they have to start the instance after navigating to the EC2 Management Console. Once started, an engineer would have to wait for the instance to start. In total, the engineer would have spent 3 minutes or more.</p><p>Calculated yearly, each engineer wastes about 21 hours starting their environment.</p><p>Think of the cost of an employee who is earning $60K a year working124,800 minutes. That employee is making $.48 cents per minute, so each day the employee’s wasted time is $1.44 multiply that by 260 work days you get $375.</p><p>For each employee, there&#39;s an opportunity cost of $375 a year per engineer to spend 3 mins a day to start an instance. It’s something I know a lot of us do and it’s usually in the morning getting ready for work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UvjM2RtyUPYl0XRgF_PfTw.jpeg" /></figure><p>Currently, we have 35 instances that were manually started from 1/23/2022 at 7 pm EST to 1/24/2022 at 9 am EST. With that in mind if those are instances just being started that comes out to be an opportunity cost of $13,125 a year. As a company grows, so will the number of employees thus increasing that cost.</p><p>Currently, I have an array of holiday dates for India &amp; the United States. A script will check if today is in the array if so, it would skip the autoStart command. I have it set to run Monday-Friday once an hour on the hour from 12 am to 8 pm GMT. So I can limit the number of invocations from the lambda function to save on costs.</p><h3><strong>Documentation:</strong></h3><p>How to use the function: Just add the tags to the desired instance. The following syntax is required to work.</p><h4>Tags Required</h4><pre>start_auto: True/False, 1/0, Off/On (Default to False if Tag not present)</pre><pre>start_time: Should be 4 digits in hhmm format representing the</pre><pre>hour and minute to start the EC2 instance</pre><pre>hour is 24 hour time format<br>start_tz: Timezone to use for when interpreting start_time<br>Valid Time Zones from<br><a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a><br>For US East use “America/New_York”<br>For India use “Asia/Calcutta”<br>start_lastdt:<br>Left blank for the script to update and patch<br>EC2 Instances will be started when all of the following are true:<br>- Instance is not running<br>- start_auto Tag is set to True (or equivalent)<br>- start_tz is a valid timezone<br>- current time hhmm &gt;&gt; start_time with current time converted to<br>start_tz timezone<br>AWS Permissions are assumed by the role assigned to the Lambda function<br>Requires ec2:DescribeInstances and ec2:StartInstances</pre><h4>EventBridge</h4><blockquote>Cronjob expression is: <strong>cron(0 0–20/1 ? * MON-FRI *)</strong></blockquote><h4>IAM Role</h4><blockquote>New role &amp; custom policy to start the instances</blockquote><h3><strong>Step One:</strong></h3><p>Before creating the lambda function, you will want to create a new IAM role with a custom permission policy. Start by making your way to the policies list located in the IAM dashboard sidebar and create a new policy.</p><p>You can use this JSON template, just replace the region and account Id.</p><pre>{<br>“Version”: “2012–10–17”,<br>“Statement”: [<br>{<br>“Effect”: “Allow”,<br>“Action”: [<br>“logs:CreateLogGroup”<br>],<br>“Resource”: “arn:aws:logs:&lt;currentRegion&gt;:&lt;accountID&gt;:*”<br>},<br>{<br>“Effect”: “Allow”,<br>“Action”: [<br>“logs:CreateLogStream”,<br>“logs:PutLogEvents”<br>],<br>“Resource”: “arn:aws:logs:&lt;currentRegion&gt;:&lt;accountID&gt;:log-group:/aws/lambda/run_autoStart:*”<br>},<br>{<br>“Action”: [<br>“ec2:StartInstances”,<br>“ec2:CreateTags”,<br>“ec2:DescribeInstances”<br>],<br>“Resource”: “*”,<br>“Effect”: “Allow”<br>}]<br>}</pre><p>Review the policy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzjBs243htfkzp27YcYhsg.jpeg" /></figure><p>Once the policy is created. We can now create an IAM role. Switch over to the <strong><em>Roles</em></strong> list and create a new role and attach the newly created policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*2zlDO9JSVjMnpyeE6YgxuA.jpeg" /></figure><p>Now we can create a lambda function. When doing so make sure you change the execution role to use an existing role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0o_EAY4Qoy-sX_RBYgr0Jg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAW8-gkABtC2ZhmX613-Cg.jpeg" /></figure><p>Once created, we can build a trigger event rule. Just add a trigger and select the EventBridge(CloudWatch Events).</p><p>Make sure you add the expression in <strong><em>cron()</em></strong>.</p><pre>cron(0 3–20/1 ? * MON-FRI *)</pre><p>Now before we move on to adding the code. Save yourself a headache later and edit the runtime settings. Replace the first part of the handler with whatever you named the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUDnpo7ivj_RuR90PaNzeQ.jpeg" /><figcaption>Use the name of the function you created</figcaption></figure><p>Once this is done we can create the function.<strong> BUT</strong> first, we need to download a <strong><em>pytz </em></strong>package so we can differentiate between timezones. You can use:</p><pre>$ pip3 install pytz</pre><p>You will find the package in the python folder. Make a copy of the package and export it to an empty folder where we’ll eventually make it a zip as that’s the only way to import an app. When at the folder, open a code editor so you can create a new file that will contain all the logic for the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*urG9_WdYsyZ8UQUUzT1XeQ.jpeg" /></figure><p>Make sure the folder is structured like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*qkeO1bzmZOj_bG7OyfwDug.jpeg" /></figure><p>For the script you can use this:</p><pre>###################################################################################<br>##  Name: autoStart.py<br>##  Purpose: to automatically start EC2 instances at a specific time<br>##           each day that are tagged appropriately<br>##<br>##  Tags Required:<br>##    start_auto:  True/False, 1/0, Off/On (Default to False if Tag not present)<br>##<br>##    start_time:  Should be 4 digits in hhmm format representing the<br>##                    hour and minute to start the EC2 instance<br>##                    hour is 24 hour time format<br>##<br>##    start_tz:    Timezone to use for when interpreting start_time<br>##                    Valid Time Zones from <br>##                      <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a><br>##                    For US East use &quot;America/New_York&quot;<br>##                    For India use &quot;Asia/Calcutta&quot;<br>##<br>##  EC2 Instances will be started when all of the following are true:<br>##     - Instance is not running<br>##     - start_auto Tag is set to True (or equivalent)<br>##     - start_tz is a valid timezone<br>##     - current time hhmm &gt;&gt; start_time with current time converted to <br>##                            start_tz timezone<br>##<br>##  AWS Permissions are assumed by the role assigned to the Lambda function<br>##      Requires ec2:DescribeInstances and ec2:StartInstances<br>##<br>##  Python Dependencies:<br>##    Package pytz must be installed locally and then uploaded into Lambda<br>##    using the zip upload option.<br>##    From same directly as this source file use:<br>##      install --target ./package pytz --system<br>##<br>##   This install the pytz package locally.  Again from the same directory<br>##   as this source file use:<br>##     zip -r9 lambda_package.zip . --exclude *.yml<br>##   The resulting zip can be uploaded into Lambda<br>##<br>####################################################################################</pre><pre>import json<br>import os<br>import boto3<br>import datetime<br>from datetime import datetime, date<br>from dateutil.parser import parse<br>import sys<br>sys.path.append(r&#39;./package&#39;)<br>import pytz</pre><pre>#############################################################################<br>##  sts_assume_role<br>##  Function only required if running locally for debug purposes<br>#############################################################################<br>def sts_assume_role( sess, arn, sessionName ):</pre><pre>sts_connection = sess.client(&#39;sts&#39;)<br>  assume_role_object = sts_connection.assume_role(RoleArn=arn, RoleSessionName=sessionName, DurationSeconds=3600)<br>  ## sess.credentials = assume_role_object[&#39;Credentials&#39;]<br>  tmp_access_key = assume_role_object[&#39;Credentials&#39;][&#39;AccessKeyId&#39;]<br>  tmp_secret_key = assume_role_object[&#39;Credentials&#39;][&#39;SecretAccessKey&#39;]<br>  security_token = assume_role_object[&#39;Credentials&#39;][&#39;SessionToken&#39;]</pre><pre>boto3_session = boto3.session.Session( aws_access_key_id=tmp_access_key,<br>                                        aws_secret_access_key=tmp_secret_key, <br>                                        aws_session_token=security_token  )<br>  return boto3_session</pre><pre>############################################################################<br>## compare date to Zaloni holidays<br>##<br>############################################################################<br>zaloni_holidays = [<br>&quot;2022-01-02&quot;,<br>&quot;2022-01-14&quot;,<br>&quot;2022-01-16&quot;,<br>&quot;2022-01-26&quot;,<br>&quot;2022-03-18&quot;,<br>&quot;2022-04-01&quot;,<br>&quot;2022-04-15&quot;,<br>&quot;2022-05-03&quot;,<br>&quot;2022-05-30&quot;,<br>&quot;2022-06-20&quot;,<br>&quot;2022-07-04&quot;,<br>&quot;2022-07-11&quot;,<br>&quot;2022-08-15&quot;,<br>&quot;2022-08-31&quot;,<br>&quot;2022-09-05&quot;,<br>&quot;2022-10-04&quot;,<br>&quot;2022-10-05&quot;,<br>&quot;2022-10-24&quot;,<br>&quot;2022-11-24&quot;,<br>&quot;2022-11-25&quot;,<br>&quot;2022-12-23&quot;,<br>&quot;2022-12-03&quot;,<br>&quot;2022-12-26&quot;<br>  ]<br>today = date.today().isoformat()<br>print(&quot;Is today a Holiday for Zaloni Employees?&quot;)<br>print(today in zaloni_holidays)<br>holiday_skip_day = today in zaloni_holidays</pre><pre>#############################################################################<br>## start_instances_for_region<br>##<br>#############################################################################<br>def start_instances_for_region( region ):</pre><pre>utc_now = pytz.utc.localize(datetime.utcnow())<br> <br>  ## master_session = boto3.session.Session( &quot;TBD KEY ID&quot;, &quot;TBD KEY SECRET ID&quot;)<br>  ## mysession = sts_assume_role( master_session, &quot;arn:aws:iam::&lt;accountID&gt;:role/cross-account-admin&quot;, &quot;tempSession1&quot; )<br> <br>  <br>  ec2_client = boto3.client(&quot;ec2&quot;, region_name=region)<br>  instances = ec2_client.describe_instances( MaxResults=800)<br>  # print( instances )<br>  i=0<br>  for x in instances[&#39;Reservations&#39;]:<br>    for instance in x[&#39;Instances&#39;]:<br>      i+=1<br>      InstanceId = instance[&#39;InstanceId&#39;] <br>      InstanceState = instance[&#39;State&#39;][&#39;Name&#39;]<br>        <br>      start_auto = False<br>      start_time = &quot;&quot;<br>      start_tz = &quot;&quot;<br>      start_lastdt = &quot;&quot;<br>      InstanceName = &quot;&quot;<br>      if &#39;Tags&#39; in instance:<br>        for tag in instance[&#39;Tags&#39;]:<br>          <br>          if ( tag[&#39;Key&#39;] == &#39;start_auto&#39; ):<br>            start_auto = tag[&#39;Value&#39;]<br>            if ( str(start_auto).lower() in (&quot;1&quot;, &quot;on&quot;, &quot;true&quot;) ):<br>              start_auto = True<br>            else:<br>              start_auto = False</pre><pre>if ( tag[&#39;Key&#39;] == &#39;start_time&#39; ):<br>            start_time = tag[&#39;Value&#39;]<br>          if ( tag[&#39;Key&#39;] == &#39;start_tz&#39; ):<br>            start_tz = tag[&#39;Value&#39;]<br>          if ( tag[&#39;Key&#39;] == &#39;start_lastdt&#39; ):<br>            start_lastdt = tag[&#39;Value&#39;]<br>          if ( tag[&#39;Key&#39;] == &#39;Name&#39; ):<br>            InstanceName = tag[&#39;Value&#39;]</pre><pre>if ( start_auto == True and InstanceState == &quot;stopped&quot;):<br>        print( &quot;Found EC2 %s (%s) in state %s and tags [%s, %s, %s]...&quot;%( InstanceName, InstanceId, InstanceState, start_auto, start_time, start_tz))<br>      <br>      if ( InstanceState == &quot;stopped&quot; and start_auto == True and start_time.isdigit() and len(start_time) == 4):<br>        print(&quot;..Instance %s (%s) is stopped and tagged for automatic start&quot;%( InstanceName, InstanceId ))</pre><pre>#############################################################<br>        ## Convert UTC_NOW to localized now so we can compare times<br>        ## and see if we need to start this machine<br>        #############################################################<br>        if ( start_tz != &quot;&quot;):<br>          if ( start_tz not in pytz.all_timezones ):<br>            print(&quot;..ERROR: Invalid Timezone String (%s) Specified in start_tz Tag for Instance %s&quot;%( start_tz, InstanceId ))<br>          else:<br>            localized_now = utc_now.astimezone(pytz.timezone( start_tz ))<br>            localized_time = ( localized_now.hour * 100 ) + localized_now.minute</pre><pre>last_start_dt = None<br>            try:<br>              if ( start_lastdt != &quot;&quot;):<br>                last_start_dt = datetime.strptime( start_lastdt, &quot;%Y-%m-%d %H:%M:%S&quot; )<br>            except ValueError as ve:<br>              print(&quot;Error parsing last start date/time: %s&quot;%( str(ve) ))<br>            except:<br>              print(&quot;Error parsing last start date/time&quot;)</pre><pre>print( &quot;..Localized Time=%s&quot;%( localized_time ))<br>            print( &quot;..Start Time=%s&quot;%( start_time ))<br>            print( &quot;..Last Start Time=%s&quot;%( start_lastdt))</pre><pre>skip_autostart = False<br>            if ( last_start_dt != None ):<br>              print( &quot;..%s %s | %s %s | %s %s&quot;% ( last_start_dt.year, localized_now.year, last_start_dt.month, localized_now.month, last_start_dt.day, localized_now.day))<br>              if ( last_start_dt.year == localized_now.year and last_start_dt.month == localized_now.month and last_start_dt.day == localized_now.day ):<br>                print(&quot;..instance already started once today, skipping auto start...&quot;)<br>                skip_autostart = True<br>          if(holiday_skip_day == False):<br>            if ( localized_time &gt;= int(start_time) and skip_autostart == False):<br>              print(&quot;..Starting instance %s (%s)...&quot;% (InstanceName, InstanceId) )<br>              response = ec2_client.start_instances( InstanceIds=[ InstanceId ] )<br>              print( response )<br>              localized_now_str = localized_now.strftime( &quot;%Y-%m-%d %H:%M:%S&quot; )<br>              print(&quot;..setting start_lastdt tag value to %s&quot;%( localized_now_str))<br>              ec2_client.create_tags(Resources=[ InstanceId], Tags=[{&#39;Key&#39;:&#39;start_lastdt&#39;, &#39;Value&#39;:localized_now_str}])</pre><pre>else:<br>        print(&quot;Skipping instance %s in state %s and start_auto=%s...&quot;%( InstanceId, InstanceState, start_auto ))</pre><pre>#############################################################################<br>##  lambda_handler<br>#############################################################################<br>def lambda_handler(event, context):<br>    <br>  #regions = [&#39;us-east-1&#39;, &#39;us-east-2&#39;, &#39;ap-south-1&#39;]<br>  regions = os.environ[&#39;region_list&#39;].replace(&quot; &quot;,&quot;&quot;).split(&quot;,&quot;)<br>  print(&quot;==============\nEnvironment regions %s...&quot;%( regions))</pre><pre>for region in regions:<br>    print(&quot;==============\nChecking region %s...&quot;%( region))<br>    start_instances_for_region( region )</pre><pre>return {<br>      &#39;statusCode&#39;: 200,<br>      &#39;body&#39;: json.dumps(&#39;Successful&#39;)<br>  }</pre><pre>## Uncomment when debugging locally<br># lambda_handler( None, None )</pre><p>You should notice 4 tags that contain <strong><em>start</em></strong> ; these tags are required on the desired EC2 instance to autoStart.</p><p>Once you create the file add it to the folder:</p><p>Once added, the next step is to zip the folder so you can upload it to the lambda function.</p><p>Make sure to review the code and everything else before proceeding. Add tags to the function itself as it is good practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qAMOjplr1j3RZxXXW7BijQ.jpeg" /></figure><p>Now it’s time to test by adding tags to instances.</p><p>Example of the tags on my instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HrX6zU_q1Ni7o5b3170ahA.jpeg" /></figure><p>Leave the <strong><em>start_lastdt</em></strong> tag blank as that will be updated by the function.</p><p>Currently the function will be invoked once an hour. For testing, I recommend changing the expression to every minute. Other than that you’re finished.</p><p>Congrats you can now officially be 3 mins lazier each day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJm-iLuUIfTdbnOff_uTiQ.jpeg" /></figure><h3><strong>Future Goals:</strong></h3><p>My future goal is to have a policy set for tagging these. Possibly creating a resource group to house the tags so we can only let a specific account tag EC2’s with the group to allow autoStart. Another goal would be to implement the BambooHR API to check if employees are on PTO or out that day, or even no longer work at the company. And if true, it would not start the instance with their name. That also means you need to implement strict requirements on instance tagging, such as requiring the owner tag for id. We can clean up the instances that are not assigned as they are not being used daily. As a company gets bigger and bigger it will need to cover all the potential losses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0b22d5f8e5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/how-to-create-an-aws-lambda-ec2-autostart-function-c0b22d5f8e5c">How to Create an AWS Lambda EC2 AutoStart Function</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Kubernetes Server on a Raspberry Pi cluster Part 1]]></title>
            <link>https://medium.com/zaloni-engineering/how-to-build-a-kubernetes-server-on-a-raspberry-pi-cluster-part-1-d10033ae0d55?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/d10033ae0d55</guid>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Matthew Caspento]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 14:59:13 GMT</pubDate>
            <atom:updated>2022-04-21T14:59:13.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bonbdo5KM7LZXP4VrXh6jw.jpeg" /></figure><p>This blog will serve as a tutorial and guide for the minimum requirements a user would need to host in the Arena platform or with a Kubernetes cluster.</p><h3><strong>Use Case Overview:</strong></h3><p>Some of the benefits of having a home server is that you can host small applications, create smart home applications, and even websites, but it’s important to ensure that you have a high upload speed to do that. Additionally, you may want to avoid the costs of using a cloud provider by using a home server. I know I’m guilty of forgetting to delete an instance and racking up quite the bill. In my case, I’m building a home server so I can practice not only my IT, but also my CloudOps skills. And the best part, I can destroy and create as much as my server can handle without worrying about the monthly cost.</p><p>If you ever watched the movie Flubber with Robin Williams, you know the movie starts with this opening scene where this rube-goldberg-like machine makes his breakfast every morning. When I was a kid I thought that was absolutely crazy, and when I grew up, I wanted something like that too. Well, I’ve grown up, and now, I want to fulfill my childhood dreams. I eventually will need to get a 3D printer, but we’ll save that for a future post.</p><p>I have a goal to create an environment so that when I have children, they will be able to engineer and create whatever they dream of. Having this server is a start to it and I welcome you to follow this engineering journey.</p><h4><strong>List of Requirements:</strong></h4><pre>3 x Raspberry Pi 4 Model B 8GB | $82.84 | <a href="https://thepihut.com/collections/raspberry-pi/products/raspberry-pi-4-model-b?variant=31994565689406">Find Here</a> | <br>2 x Cluster Case for Raspberry Pi(with fans)*| $11.27 | <a href="https://thepihut.com/collections/raspberry-pi-cases/products/cluster-case-for-raspberry-pi">Find Here</a> |<br>3 x Micro SD Cards 128Gb* | $21.79 | <a href="https://www.amazon.com/SanDisk-128GB-Extreme-microSD-Adapter/dp/B07FCMKK5X/ref=sxin_15_ac_d_mf_rf?ac_md=2-1-MTI4IEdC-ac_d_mf_rf_rf&amp;crid=STNH6CB2PTUM&amp;cv_ct_cx=micro+sd+card&amp;keywords=micro+sd+card&amp;pd_rd_i=B07FCMKK5X&amp;pd_rd_r=0687926d-6c20-4483-b8e5-100ecd6e7fe5&amp;pd_rd_w=wptzP&amp;pd_rd_wg=lN6fI&amp;pf_rd_p=a096e525-a495-453a-86b7-b8874baad0af&amp;pf_rd_r=1A93Q2YD6QFEQKQH50DF&amp;psc=1&amp;qid=1641309201&amp;sprefix=micro%2Caps%2C88&amp;sr=1-2-1db1fce3-1628-43df-a6c6-84620ba4aaaa">Find Here</a> |<br>3 x Mini PoE Expansion HAT | $27.79 | <a href="https://thepihut.com/products/mini-power-over-ethernet-poe-expansion-board-for-raspberry-pi-4-no-fan">Find Here</a> |<br>1 x USB keyboard*<br>1 x HDMI to microHDMI cable*| $3.38 | <a href="https://thepihut.com/collections/raspberry-pi-cables/products/hdmi-to-micro-hdmi-adapter-cable-160mm">Find Here</a><br>3 x Ethernet Cat6 cords* | $1.69 | <a href="https://thepihut.com/collections/raspberry-pi-ethernet-cables/products/rj45-cat5e-ethernet-lan-cable-2m-red">Find Here</a> | #EthernetCables.jpg<br>1 x TP-Link AC1900 Smart WiFi Router| $59.99 | <a href="https://www.amazon.com/dp/B08C3YBBHM?psc=1&amp;ref=ppx_yo2_dt_b_product_details">Find Here</a> |<br>1 x TP-link 5-Port Gigabit PoE Switch | $42.89 | <a href="https://www.amazon.com/gp/product/B076HZFY3F/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&amp;psc=1">Find Here</a> |</pre><pre>*optional</pre><pre>Total cost may vary depending on the optional choices you make on this build*</pre><pre>Shipping prices are not included*</pre><pre>Total: $556.48</pre><pre>Having a home server to automate breakfast: Eggcellent</pre><h3><strong>Building the Raspberry Pi Cluster:</strong></h3><p>You’re gonna want to start with building the cluster case. The build should take 30 mins.</p><p><strong>WARNING: DO NOT BUILD OVER A CARPET.</strong></p><p>These bolts are tiny! This warning was in every tutorial I followed. Unfortunately for me, I ignored the documentation and ended up taking a comb to my carpet as if I were one of the troopers in “Spaceballs” combing the desert.</p><p>You can follow along with the provided pictures to assemble the ClusterCase with Pi’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ie_FcX7wIx5kevejWNEzgQ.jpeg" /></figure><p>You’re gonna want to make sure the round nuts are on top and not the bottom so the case does not slide around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BowPF4Ibfut9As5JerVMA.jpeg" /></figure><p>Add the first pi to the glass stand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Va-G_da8lkh7o22IIcWcsQ.jpeg" /></figure><p>Add the new glass level, but this time, include the fan and attach it to the pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSnaALKdriXnVmqsyJUV6w.jpeg" /></figure><p>Once you have the new level and have added it to the case, finish by attaching another raspberry pi to the case and the top level with the attached fan.</p><p>Once the case and Pis are set up, we move to the next step by installing the operating system. In this blog, we will be using Ubuntu.</p><p>First, you will want to download the Raspberry Pi Imager; you can go can use one of the following to do so:</p><ul><li>Go to ubuntu and use <a href="https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview">this link</a> to follow their instructions Download one of the following:</li><li><a href="https://downloads.raspberrypi.org/imager/imager_latest_amd64.deb">Raspberry Pi Imager for Ubuntu</a></li><li><a href="https://downloads.raspberrypi.org/imager/imager_latest.exe">Raspberry Pi Imager for Windows</a></li><li><a href="https://downloads.raspberrypi.org/imager/imager_latest.dmg">Raspberry Pi Imager for macOS</a></li><li>Use:</li></ul><pre>$ sudo snap install rpi-imager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uRmyLJ8vVmMj2miumfgsA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8B-clc48WAt3WeZpSdRNQ.jpeg" /><figcaption>(I’m using the Ubuntu Server 20.04.3 LTS(RPI3/4/400) OS)</figcaption></figure><h3><strong>Reserving Static Addresses:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNpNgTOexMzEjWVJsbnpLg.jpeg" /></figure><p>Before we address the raspberry pi’s, you will need to set up the router and PoE switchboard to utilize the PoE HATS. If you don’t want to use the HATS use the power supply plugs. Plugin the router to your ISP router that is already connected to the internet, find the connection and connect to it. The next step is to go to the address <a href="http://tplinkwifi.net/">http://tplinkwifi.net</a> and create a new login to sign in. You can skip the quick setup and go to the console where you will find the advanced settings and the network tab where we will do most of the editing.</p><p>To start, let’s first configure the LAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9hTPaQc67C4IDWqkP215g.jpeg" /><figcaption>Make sure you are on router mode.</figcaption></figure><pre>LAN</pre><pre>Ip Address: 10.204.4.1</pre><pre>SubnetMask: 255.255.255.0</pre><p>Next, if you go to the Internet tab, you will see a drop-down for the Internet Connection Type and choose <strong><em>Dynamic IP.</em></strong> Since you have connected the router to your ISP router, it dynamically sets the parameters requested.</p><p>With that step done, we will now focus on the DHCP server. Make sure that the DHCP server is enabled and the Raspberry Pis are on and connected to the switchboard connected to the router. By doing so, the router will automatically identify the Raspberry Pis and they will be visible on the DHCP Client List. Note the MAC address as you will need that later to set the static IP addresses for the Pi’s. You can use this as an example of how it should look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*cbbWlujShOLnCDNllDDSHg.jpeg" /></figure><p>Once completed, you can check the internet connection by going to any website and making sure it loads.</p><p>Now, to set the static IP addresses, the <strong><em>Address Reservation </em></strong>section on the page<strong><em> </em></strong>is where we will assign the IP address of the RaspberryPis:</p><pre>Device Name| Mac Address| Reserved Ip Address|</pre><pre>Kube-master| R7–3J-95–8H-KL-Y2| 10.204.4.101|</pre><pre>Kube-worker-1| R7–3J-95–9U-T4-X1| 10.204.4.100|</pre><h4><strong>Setting up the Pi Kernel:</strong></h4><p>Once you install the OS to the correct SD card, transfer them to the pi’s and plug in the power supply, micro HDMI, and keyboard. Give it 2 to 3 mins to load, but when you see the insert username, wait until it has more scripts run. If you were able to set a static IP address, another way you can access the Pi’s is by adding the SSH into them from your local computer.</p><pre>$ ssh ubuntu@10.204.4.100</pre><p>Once that is finished, you can use these credentials:</p><pre>Username: ubuntu</pre><pre>Password: ubuntu</pre><p>Once logged in, you will be prompted to change your password. Use any password of your choosing.</p><p>Once you have officially logged into your raspberry pi, we will start running it.</p><pre>$ sudo dhclient eth0</pre><p>The next step would be to determine the IP address of the Raspberry Pi’s so you can SSH into them later.</p><p>On Ubuntu, you can run:</p><pre>$ arp -na | grep -i “b8”</pre><p>Note, if you don’t have arp installed, you can run:</p><pre>$ sudo apt install net-tools</pre><p>You can now SSH into that board from any terminal.</p><p>Open a terminal and run:</p><pre>$ ssh ubuntu@&lt;RASBERRYPI-IP-ADDRESS&gt;</pre><p>Confirm you want to connect.</p><p>You will have officially connected to the Pi when the connection is confirmed. You can now add your SSH key if you want to save time for future SSH attempts:</p><p>Now, you will need to enable cgroups limit support. You will want to add these to the <strong><em>/boot/firmware/cmdline.txt</em></strong> file</p><p>Run the following command:</p><pre>$ sudo vim /boot/firmware/cmdline.txt</pre><p>Then add the following to the file:</p><pre>cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V2o2EG0jgv9YMBvXlIZLSQ.jpeg" /></figure><p>After doing so you will need to restart the kernel for the changes to take effect, so run the following:</p><pre>$ sudo reboot</pre><p>Make sure you follow the same steps for each board as they all need to be running an Ubuntu Server image.</p><p>Now if you’re like me and have recently gotten their <a href="https://www.cncf.io/certification/cka/">CKA</a>, you want to flex those muscles and utilize everything Kubernetes offers. With that in mind, I’ll be using Kubeadm to set up the clusters and for the second part of the tutorial I will be creating &amp; installing the infrastructure to host Arena Concourse, something I’ll be making a tutorial later in the year.</p><p>*In the next tutorial I will also add a factor of any new additional costs for any of the new infrastructure based on energy costs.</p><p>Before we start installing kubernetes we will need a Docker engine to do so. I’ll catch you in part 2.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d10033ae0d55" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/how-to-build-a-kubernetes-server-on-a-raspberry-pi-cluster-part-1-d10033ae0d55">How to Build a Kubernetes Server on a Raspberry Pi cluster Part 1</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Troubleshoot java.lang.NoClassDefFoundError: org/apache/log4j/Level]]></title>
            <link>https://medium.com/zaloni-engineering/troubleshooting-java-lang-noclassdeffounderror-org-apache-log4j-level-c8ae086bbaca?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/c8ae086bbaca</guid>
            <dc:creator><![CDATA[Amar Gurung]]></dc:creator>
            <pubDate>Thu, 24 Feb 2022 18:47:07 GMT</pubDate>
            <atom:updated>2022-03-15T20:05:50.340Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><blockquote>One of the common Error we encounter in Java applications is <strong>java.lang.NoClassDefFoundError</strong></blockquote><blockquote>As per Oracle Java 8 Doc <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoClassDefFoundError.html">https://docs.oracle.com/javase/8/docs/api/java/lang/NoClassDefFoundError.html</a></blockquote><blockquote>Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.</blockquote><p><strong>Why &amp; How the issue may pop up</strong></p><p>Our Application supports both Hadoop-2 &amp; Hadoop-3 dependencies. Due to the major refactoring task of migrating the logging framework from <strong>log4j2 2.8</strong> to <strong>Logback 1.2.3</strong>. We removed all the log4j2 dependencies from the code, and in the process, we forgot to test the application in the Hadoop-2 build.</p><p>The <em>org.apache.hadoop.mapred.JobConf.class</em><strong> </strong>in the Hadoop-2 <strong>hadoop-mapreduce-client-core-2.7.2.jar</strong> still uses log4j imports. So, the Application code failed to initialize the Local FileSystem using Hadoop-2 dependent jars.</p><p><strong>Java Code ( trimmed for clarity )</strong></p><pre>import org.apache.hadoop.fs.FileSystem;<br>import org.apache.hadoop.conf.Configuration;</pre><pre>public static void main(String args[]){<br>.....</pre><pre>Configuration config = new Configuration();<br>FileSystem localFileSystem = FileSystem.<em>getLocal</em>(config);<br>......</pre><pre>}</pre><p><strong>Exception Stack Trace</strong></p><pre>Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Level<br> at org.apache.hadoop.mapred.JobConf.&lt;clinit&gt;(JobConf.java:351)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:348)<br> at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:2247)<br> at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:95)<br> at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)<br> at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)<br> at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:102)<br> at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:97)<br> at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:463)<br> at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:328)<br> at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:295)<br> at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:850)<br> at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:820)<br> at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:693)<br> at org.apache.hadoop.fs.FileSystem$Cache$Key.&lt;init&gt;(FileSystem.java:2953)<br> at org.apache.hadoop.fs.FileSystem$Cache$Key.&lt;init&gt;(FileSystem.java:2943)<br> at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2809)<br> at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:389)<br> at org.apache.hadoop.fs.FileSystem.getLocal(FileSystem.java:360)</pre><p><strong>Analysis of JobConf.class</strong></p><p>Source code for <em>org.apache.hadoop.mapred.JobConf.class </em>( <strong>trimmed </strong>for clarity ) from <strong>hadoop-mapreduce-client-core-2.7.2.jar</strong></p><pre>import org.apache.log4j.Level;<br><em><br></em>@InterfaceAudience.Public<br>@InterfaceStability.Stable<br>public class JobConf extends Configuration {<br><br>  private static final Log <em>LOG </em>= LogFactory.<em>getLog</em>(JobConf.class);</pre><p>Interestingly, the same piece of Java code is working fine with Hadoop-3. The reason being log4j imports are replaced with slf4j imports.</p><p>Source code <em>org.apache.hadoop.mapred.JobConf.class</em> ( <strong>trimmed </strong>for clarity ) from <strong>hadoop-mapreduce-client-core-3.2.0.jar</strong></p><pre>import org.slf4j.Logger;<br>import org.slf4j.LoggerFactory;<br><a href="http://twitter.com/InterfaceAudience">@InterfaceAudience</a>.Public<br><a href="http://twitter.com/InterfaceStability">@InterfaceStability</a>.Stable<br>public class JobConf<br>extends Configuration<br>{<br>private static final Logger LOG = LoggerFactory.getLogger(JobConf.class);</pre><p><strong>Identify &amp; validate log4j-1.2-api-2.8.jar</strong></p><p>Check whether org/apache/log4j/Level.class is present in <strong>log4j-1.2-api-2.8.jar </strong>using <strong>jar </strong>command.</p><pre>$ jar tvf log4j-1.2-api-2.8.jar | grep &quot;Logger&quot;<br>1034 Sun Jan 22 05:24:58 IST 2017 org/apache/log4j/Logger$PrivateManager.class<br>1880 Sun Jan 22 05:24:58 IST 2017 org/apache/log4j/Logger.class<br>208 Sun Jan 22 05:24:58 IST 2017 org/apache/log4j/spi/LoggerFactory.class<br>914 Sun Jan 22 05:24:58 IST 2017 org/apache/log4j/spi/LoggerRepository.class</pre><p><strong>Resolution</strong>:</p><p>After adding the <strong>log4j-1.2-api </strong>dependency in the application code. The issue got resolved.</p><p><strong>Conclusion</strong></p><p>In this blog, readers walked through the <strong>java.lang.NoClassDefFoundError , </strong>how and why issue cropped up and resolution of the issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8ae086bbaca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/troubleshooting-java-lang-noclassdeffounderror-org-apache-log4j-level-c8ae086bbaca">How to Troubleshoot java.lang.NoClassDefFoundError: org/apache/log4j/Level</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy Static HTML Site Using Docker and Ngnix]]></title>
            <link>https://medium.com/zaloni-engineering/how-to-deploy-static-html-site-using-docker-and-ngnix-de2cf7bda2db?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/de2cf7bda2db</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Amar Gurung]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 17:45:16 GMT</pubDate>
            <atom:updated>2022-02-15T17:45:16.308Z</atom:updated>
            <content:encoded><![CDATA[<h3>Content:</h3><blockquote>1. Install Docker in Linux VM.</blockquote><blockquote>2. Create a simple “Hello World HTML” page.</blockquote><blockquote>3. Steps to deploy HTML page using Docker and Nginx.</blockquote><blockquote>4. Summary</blockquote><p><strong>Docker installation commands</strong></p><pre>$ sudo yum install -y yum-utils<br>$ sudo yum-config-manager \<br>— add-repo \<br><a href="https://download.docker.com/linux/centos/docker-ce.repo">https://download.docker.com/linux/centos/docker-ce.repo</a><br>$ sudo yum install docker-ce docker-ce-cli containerd.io<br>$ sudo systemctl start docker<br>$ sudo docker run hello-world</pre><p><strong>Create HTML page</strong></p><pre>[centos@ip-10-203-4-144 ~]$ vi hello.html<br>[centos@ip-10-203-4-144 ~]$ cat hello.html<br>&lt;P&gt; HELLO WORLD &lt;/P&gt;</pre><p><strong>Steps to deploy HTML site:</strong></p><ol><li>Dockerfile contains code to represent the image we’re going to use along with copying the contents of the current directory into the container.</li><li>Add the current user to the docker group and change the primary group.</li><li>Build docker image.</li><li>Confirm whether the image is created.</li><li>Run docker container.</li><li>Test whether the HTML site is reachable or not using curl command or browser.</li></ol><pre>[centos@ip-10-203-4-144 ~]$ vi Dockerfile<br>[centos@ip-10-203-4-144 ~]$ cat Dockerfile<br>FROM nginx:alpine<br>COPY . /usr/share/nginx/html</pre><pre>[centos@ip-10-203-4-144 html]$ sudo usermod -aG docker $USER &amp;&amp; newgrp docker</pre><pre>[centos@ip-10-203-4-144 html]$ docker build -t html-server-image:hello_v1 .<br>Sending build context to Docker daemon  3.072kB<br>Step 1/2 : FROM nginx:alpine<br>alpine: Pulling from library/nginx<br>540db60ca938: Pull complete<br>197dc8475a23: Pull complete<br>39ea657007e5: Pull complete<br>37afbf7d4c3d: Pull complete<br>0c01f42c3df7: Pull complete<br>d590d87c9181: Pull complete<br>Digest: sha256:07ab71a2c8e4ecb19a5a5abcfb3a4f175946c001c8af288b1aa766d67b0d05d2<br>Status: Downloaded newer image for nginx:alpine<br>---&gt; a64a6e03b055<br>Step 2/2 : COPY . /usr/share/nginx/html<br>---&gt; 131fd26c067f<br>Successfully built 131fd26c067f<br>Successfully tagged html-server-image:hello_v1</pre><pre>[centos@ip-10-203-4-144 html]$ docker images<br>REPOSITORY          TAG        IMAGE ID       CREATED              SIZE<br>html-server-image   hello_v1   131fd26c067f   About a minute ago   22.6MB</pre><pre>[centos@ip-10-203-4-144 html]$ docker run -d -p 80:80 html-server-image:hello_v1<br>dd87e0ff6b5c7f36c788a3113aeeaecf8958d066ec7b357491cafbf09284499f</pre><pre>[centos@ip-10-203-4-144 html]$ curl localhost:80/hello.html<br>&lt;P&gt; HELLO WORLD &lt;/P&gt;<br></pre><h3><strong>Summary</strong>:</h3><blockquote>This blog walks you through list of Linux commands to install Docker and deploy an HTML site using Docker and Nginx.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqlWgLFW7Tn77_gG3eJwEQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de2cf7bda2db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/how-to-deploy-static-html-site-using-docker-and-ngnix-de2cf7bda2db">How to Deploy Static HTML Site Using Docker and Ngnix</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Read Data from Hive & Write to MS SQL Table Using Spark-Shell]]></title>
            <link>https://medium.com/zaloni-engineering/how-to-read-data-from-hive-write-to-ms-sql-table-using-spark-shell-9ed825ce0b2d?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/9ed825ce0b2d</guid>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[mssql]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Amar Gurung]]></dc:creator>
            <pubDate>Thu, 13 Jan 2022 18:00:20 GMT</pubDate>
            <atom:updated>2022-01-13T18:00:20.050Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blog Overview:</h3><p><em>This blog walks readers through the proper use case pre-requisites and steps to read data from Hive and write to MS SQL Server Table use case.</em></p><h4>Pre-requisites for Use Case:</h4><ol><li>scala</li><li>spark-shell</li><li>beeline</li><li>hive 3.1.0</li><li>spark 2.3.2</li><li>mssql-cli v: 1.0.0 ( <strong>Refer </strong><a href="https://github.com/dbcli/mssql-cli/blob/master/doc/installation/linux.md">https://github.com/dbcli/mssql-cli/blob/master/doc/installation/linux.md</a> )</li><li>Driver sqljdbc4–2.0.jar</li></ol><h3>Use Case Steps:</h3><ol><li><strong>Create Hive Table using Beeline</strong></li></ol><pre>create database organization_db;<br>create table employee(id int,name string) <br>ROW FORMAT DELIMITED<br>FIELDS TERMINATED BY &#39;,&#39;<br>LINES TERMINATED BY &#39;\n&#39;<br>STORED AS TEXTFILE;</pre><p><strong>2. Create a CSV file &amp; copy it to the HDFS path</strong></p><pre>[~]$ cat emp.csv<br>1,rohan<br>2,amar<br>3,jeet<br>[~]$ hadoop fs -put emp.csv hdfs://hdp314/warehouse/tablespace/managed/hive/organization_db.db/employee<br>[~]$ hadoop fs -cat hdfs://hdp314/warehouse/tablespace/managed/hive/organization_db.db/employee/emp.csv<br>1,rohan<br>2,amar<br>3,jeet</pre><p><strong>3. Create MS SQL Table</strong></p><pre>mssql-cli -U &lt;username&gt; -P &lt;password&gt; -S &lt;sql server ip/hostname&gt; -d &lt;db_name&gt;<br>db_name&gt; create database orgdb;</pre><pre>Time: 1.005s (a second)</pre><pre>Commands completed successfully.</pre><pre>db_name&gt; use orgdb;</pre><pre>Time: 0.502s</pre><pre>Commands completed successfully.</pre><pre>orgdb;&gt; create schema org;</pre><pre>Time: 0.453s</pre><pre>Commands completed successfully.</pre><pre>orgdb;&gt; create table org.employee(id int primary key , name varchar(1024));</pre><pre>Time: 0.453s</pre><pre>Commands completed successfully.</pre><p><strong>4. Scala Code</strong></p><pre>val hiveDf = spark.sql(&quot;select * from organization_db.employee&quot;)<br>hiveDf.show()<br>val df = hiveDf.write.format(&quot;jdbc&quot;).mode(org.apache.spark.sql.SaveMode.Overwrite)<br>df.option(&quot;url&quot;,&quot;jdbc:sqlserver://&lt;sql-server-ip&gt;:1433;databaseName=orgdb&quot;).option(&quot;driver&quot;,&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;).option(&quot;dbtable&quot;, &quot;org.employee&quot;).option(&quot;user&quot;, &quot;sa&quot;).option(&quot;password&quot;,&quot;xxxxx&quot;).save()</pre><p><strong>5. Invoke spark-shell &amp; paste the above code</strong></p><pre>spark-shell --master yarn --jars /&lt;path-to-driver&gt;/sqljdbc4-2.0.jar</pre><p><strong>6. Sample output of the spark-shell</strong></p><pre>[~]$ spark-shell --master yarn --jars &lt;driver-path&gt;/sqljdbc4-2.0.jar</pre><pre>Setting default log level to &quot;WARN&quot;.</pre><pre>To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).</pre><pre>Spark context Web UI available at http://xxxxx:4041</pre><pre>Spark context available as &#39;sc&#39; (master = yarn, app id = application_1630517835182_0012).<br>Spark session available as &#39;spark&#39;.<br>Welcome to<br>____              __</pre><pre>/ __/__  ___ _____/ /__</pre><pre>_\ \/ _ \/ _ `/ __/  &#39;_/</pre><pre>/___/ .__/\_,_/_/ /_/\_\   version 2.3.2.3.1.4.0-315</pre><pre>/_/</pre><pre>Using Scala version 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_271)</pre><pre>scala&gt; val hiveDf = spark.sql(&quot;select * from organization_db.employee&quot;)</pre><pre>hiveDf: org.apache.spark.sql.DataFrame = [id: int, name: string]</pre><pre>scala&gt; hiveDf.show()</pre><pre>+---+-----+</pre><pre>| id| name|</pre><pre>+---+-----+</pre><pre>|  1|rohan|</pre><pre>|  2| amar|</pre><pre>|  3| jeet|</pre><pre>+---+-----+</pre><pre>scala&gt; val df = hiveDf.write.format(&quot;jdbc&quot;).mode(org.apache.spark.sql.SaveMode.Overwrite)</pre><pre>df: org.apache.spark.sql.DataFrameWriter[org.apache.spark.sql.Row] = org.apache.spark.sql.DataFrameWriter@21838ea3</pre><pre>scala&gt; df.option(&quot;url&quot;,&quot;jdbc:sqlserver://xxxxx:1433;databaseName=orgdb&quot;).option(&quot;driver&quot;,&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;).option(&quot;dbtable&quot;, &quot;org.employee&quot;).option(&quot;user&quot;, &quot;sa&quot;).option(&quot;password&quot;,&quot;xxxx&quot;).save()</pre><p><strong>7. Validate the data in MS SQL Table</strong></p><pre>[amar@crrt-edge ~]$ mssql-cli -U &lt;user_name&gt; -P &lt;password&gt; -S &lt;sql server ip/hostname&gt;-d orgdb</pre><pre>orgdb&gt; select * from org.&quot;employee&quot;;</pre><pre>Time: 4.674s (4 seconds)</pre><pre>+------+--------+</pre><pre>| id   | name   |</pre><pre>|------+--------|</pre><pre>| 3    | jeet   |</pre><pre>| 1    | rohan  |</pre><pre>| 2    | amar   |</pre><pre>+------+--------+</pre><pre>(3 rows affected)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bm84AHg5Prp5oZMLe_f_A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ed825ce0b2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/how-to-read-data-from-hive-write-to-ms-sql-table-using-spark-shell-9ed825ce0b2d">How to Read Data from Hive &amp; Write to MS SQL Table Using Spark-Shell</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Change Authors of Pushed Git Commits]]></title>
            <link>https://medium.com/zaloni-engineering/how-to-change-authors-of-pushed-git-commits-6fe74993365f?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/6fe74993365f</guid>
            <category><![CDATA[correct-git-author]]></category>
            <category><![CDATA[git-for-beginners]]></category>
            <category><![CDATA[git-commit]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[rewrite-commit]]></category>
            <dc:creator><![CDATA[Pranjal Goswami]]></dc:creator>
            <pubDate>Thu, 01 Jul 2021 16:44:48 GMT</pubDate>
            <atom:updated>2021-07-06T13:29:14.405Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“In the world of software engineering, mistakes are inevitable, but what really matters is how you overcome those mistakes, learn from them and strengthen yourself.”</em></p><h3>Why I Chose to Write this Blog</h3><p>One night last week, I switched between my work-related repository and personal repository. I made several commits in each repository before pushing those changes to git in their respective repositories. After that, everything was fine, and both the repositories were working fine.</p><p>Friday evening, when I completed my tasks for the week and went to raise a pull request for my code to be pushed to the work-related repository, I found the mistake I had made. As I looked at the author details of the commits I made included the name and email configured for my personal repository.</p><p>Here is a snapshot of what my commit history looked like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sG_ksXqq3IMRjiMKSmr3YA.png" /></figure><p>For this blog, I will walk through the steps I have performed to correct <em>coolpran4u</em> to <em>Pranjal Goswami </em>(reference image above)<em>. </em>You may use the same steps if you are in the same situation. (Now that you are reading this blog, there is a 77% chance that you might have encountered similar situations at some point in time).</p><p>At least for me anyway, and as you might have already guessed, the very first step was a panic attack — “Ah! What have I done!?”</p><p>Step two is the more logical step, take a deep breath and tell yourself that you are not the first to make this mistake, and there must be someone on the internet who did the same thing and overcame it. After all, people managing git are smart enough to have predicted such incidents and may have already prepared a solution to resolve such a problem. So, with this positive attitude, let’s do a bit of googling!</p><h3>Solution: Correct Author Details</h3><p>Well, these kinds of mistakes happen, and there is no need to worry. Git has a way to correct your commit details. If you have pushed just one commit with the wrong author details, then you can correct your last commit details using the following:</p><pre>git commit --amend --author=&quot;&lt;firstName lastName&gt; &lt;email@email.com&gt;&quot;<br>git push</pre><p>If there is more than one commit that needs to be corrected, it becomes tricky. First, you need to use the strongest git command called <em>rebase. </em>Rebase is the master of everything in git. You probably know about it already, but you should use it at a minimum because it can mess things up badly if misused. You can find more on <em>rebase</em> <a href="https://git-scm.com/docs/git-rebase">here</a>.</p><p>There are five easy steps to iteratively correct the author details:</p><ol><li>Point the repository to the last correct commit so that all commits after that can be corrected. Use the following rebase command to do that:<br>git rebase –i &lt;last-correct-commit-hash&gt;</li><li>The above command will display a list of commit hashes after the specified commit (ordered by newest to oldest). This list usually opens in a vi/vim view, as shown below.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*21C72DSTQ5d6QSpVbwWK2w.png" /><figcaption>commit list in vim view</figcaption></figure><p>Press “i” for editing the view. Change the word pick to edit for each commit that needed to be corrected. Then save and quit (!wq).</p><p>3. Once you save the changes and quit, the rebase process will start, and you should be able to correct the authors of each commit one after another using the following command:</p><p>git commit --amend --author=&quot;&lt;Author Author&gt; &lt;email@email.com&gt;&quot;</p><p>4. Once you have corrected one commit, go to the next commit and use the following command:</p><p>git rebase –continue</p><p>5. Finally, once all the commits are corrected, you should be good to push your changes using the following command:</p><p>git push</p><p>Hurray! You have done it! All of the bad commits are now corrected.</p><p><em>I hope you liked the blog, and it helped resolve your issue.</em></p><h3>A Tip from the Author</h3><p>As a precautionary measure, it is advised to set authors per repository rather than at the global level to avoid messing up author credentials across the entire repository. You may want to run the following commands by opening a terminal inside your respective repositories:</p><pre>git config user.email &quot;repos_email@repo_email.com&quot;<br>git config user.name &quot;repo_AuthorFirstName repo_AuthorLastName&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ziQU1ca3XHxQS6phjMTVHA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fe74993365f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/how-to-change-authors-of-pushed-git-commits-6fe74993365f">How to Change Authors of Pushed Git Commits</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Benefits of SOLID Design Principles. What a beautiful S!]]></title>
            <link>https://medium.com/zaloni-engineering/benefits-of-solid-design-principles-what-a-beautiful-s-5d55477d15f3?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d55477d15f3</guid>
            <category><![CDATA[single-responsibility]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[design-principles]]></category>
            <category><![CDATA[rp]]></category>
            <category><![CDATA[solid-principles]]></category>
            <dc:creator><![CDATA[Pranjal Goswami]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 14:22:14 GMT</pubDate>
            <atom:updated>2021-06-22T14:36:20.141Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of software engineering, writing code is the easiest part, while the hardest is maintaining clean code. One of the questions that I often asked myself during my initial days of software development is, am I doing this right or introducing tight coupling? Even though it seems like a simple question, trust me, it may be tougher than you think to get the correct answer. So, I started reading about design principles and tried to apply them in any code I write.</p><p>Design principles are a set of best-practice concepts that can be implemented and maintained to ensure clean code. These principles have been tried and tested by so many developers over time. Think of these principles as the doctor for your code that helps keep your application clean, safe, and secure.</p><p>SOLID is an acronym for five design principles intended to make software designs more understandable, flexible, and maintainable. These five principles are guidelines that may not be mandatory but are highly recommended for better software development. The principles are listed below:</p><ol><li><em>Single Responsibility Principle</em></li><li><em>Open/Close Principle</em></li><li><em>Liskov Substitution principle</em></li><li><em>Interface Segregation Principle</em></li><li><em>Dependency Inversion Principle.</em></li></ol><p>There are tons of documents on the internet explaining these principles. In this blog, I will walk readers through these principles one at a time and provide examples of real-world scenarios to understand better how these principles provide better and cleaner software development.</p><h3>To start with, let’s deep dive into SRP today.</h3><p>Single Responsibility Principle (SRP) is, in a way, very simple, but at the same time, slightly confusing. <strong><em>SRP states that there should never be more than one reason for a class to change</em></strong>. In other words, a class should have a very specific purpose for its existence. It should be focused on one particular functionality and should not care about any additional functionality that may or may not be interdependent with the core functionality of the class.</p><p>Let’s walk through an example to understand a bit more. Let’s take the most common use case: logging in. We are going to create login functionality for a website. To start, let’s figure out what should be considered for a user to log in.</p><ol><li>The user will provide a username and password.</li><li>The application will validate username and password in some data source.</li><li>If credentials are valid, it will log in and send a success message; if not, it will send a failure message.</li></ol><p>While keeping these three points in mind, let’s write some code to implement the feature. For now and for simplicity, we will use a hardcoded map for storing username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*emwxn3DaKzmmWPhOOWFofQ.png" /><figcaption>login implementation</figcaption></figure><p>If we look into the above code, it seems alright, right? We have two usernames and passwords stored in the datastore method. A username and password are initialized in the main method, using the username to get the password from the datastore. If the password from the datastore matches the given password, we consider credentials valid and print a success message; else, we print a failure message. So far, so good!</p><p>Well, not so much… Even though this code will run and do the job, looking closely, you will notice that this class is doing so many things: taking input username and password, validating input credentials, managing datastore, and finally printing message(s). This class is responsible for many things, meaning this class will change for any change in behavior for any of these components. If you would like to store data in a database or a file instead of the map, you need to change this class. Maybe you would like to log message rather than doing a System.out.println(..), that too calls for a change in this class. If you want the input username to come from a json/yaml file or a REST endpoint- the class needs to change again. It is evident that this class doesn’t have a single responsibility and is prone to quick changes, so ultimately, this class violates SRP.</p><p>The idea of having a Login.class is to help users pass credentials to the application for login. So this class should only change if we change the way the credentials are passed to the class and in no other cases. Login should not worry about the validation logic in place, the way the message is displayed, and etc.</p><p>Now that we are clear with the class’s responsibility let’s first try to make the class modular; in other words, separate each concern into smaller methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uDosMjO76JSvMY9AIy-6g.png" /><figcaption>refactored existing login code to smaller method specific to each concerns</figcaption></figure><p>If you look into the code, we have separated each concern into smaller methods, giving us a good picture of the class’s responsibilities. Now the next step is to look into the class and try to define it.</p><p>I can define the class to be responsible for <em>login </em><strong><em>and</em></strong><em> validation </em><strong><em>and</em></strong><em> storing data </em><strong><em>and</em></strong><em> printing success </em><strong><em>and</em></strong><em> failure messages</em>. As a rule of thumb, whenever the word AND comes while defining the purpose of a class it tells that it is violating SRP and each contributor of the AND statement has to be written in separate classes. Let’s now try to refactor this class into smaller classes, each having a single responsibility.</p><p>The first step would be to define packages corresponding to each responsibility. I have used the following packages:</p><ol><li>caller: This package will contain the main class that will be responsible for calling the login logic with user credentials.</li><li>controller: This package will have the Class that talks with all other classes to perform the login operation.</li><li>datastore: This package is responsible for holding classes that will manage stored data</li><li>message: As the name suggests this package will have classes responsible for generating messages</li><li>validator: The class with validation logic will reside here.</li></ol><p>Below is the new code, each class having a single responsibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4_nLqR3_f3-0dXXmaaXoA.png" /><figcaption>responsible for passing credentials for login</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TJ0XAUaxnuW_xf0jTHfYg.png" /><figcaption>responsible for validating credentials</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*UToz6aTlugHR6hYE-qhlqg.png" /><figcaption>responsible of printing message</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kNNsTBPs6GQzJK8dffbjQ.png" /><figcaption>Responsible for controlling the flow of the application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qN6nXKhS_dRaZ4-eSQzgsg.png" /><figcaption>Responsible for calling the login application with credentials</figcaption></figure><p>With these changes, each class now has a single responsibility, you want to change the calling mechanism from main method to REST api, you just need to change LoginCaller and that is it, no other class needs to be changed. You want to change the way data is stored, change the logic of LoginDatabase.datastore() method and you will be done. The same is true for Message and LoginController.</p><p>As each class is doing its part and then calling a method of another class, so any changes inside those methods is unknown to the caller classes as long as the method signature remains intact. So in case something changes inside a method of a class, the caller need not have to know and worry if the code will run or not. This is the biggest benefit of SRP.</p><p>With this let’s revisit the definition of SRP- <strong><em>SRP states that there should never be more than one reason for a class to change. </em></strong>Hope with the aforementioned explanation, this definition is now much more clearer.</p><h4>Notes from the author:</h4><p>This article attempts to encourage new developers to understand the concepts of design principles and help them decide how to implement SRP while writing a piece of code. I have tried to keep the code simple so that it is easier to understand, even for those who are new to Java. The code shown in this article can be found at <a href="https://github.com/coolpran4u/design-principles">Github</a>.</p><p>Though the code in this article is written in Java, know that the design principle language is agnostic. Design principles are a set of specifications or best practices that is true for any programming language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JU7FDP_lkY_oQMEfTg_-Lw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d55477d15f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/benefits-of-solid-design-principles-what-a-beautiful-s-5d55477d15f3">Benefits of SOLID Design Principles. What a beautiful S!</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSON Data Type Support in MariaDB 10.2.x]]></title>
            <link>https://medium.com/zaloni-engineering/json-data-type-support-in-mariadb-10-2-x-5dffae7d4938?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/5dffae7d4938</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[mariadb-support]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Amar Gurung]]></dc:creator>
            <pubDate>Thu, 13 May 2021 14:41:52 GMT</pubDate>
            <atom:updated>2021-07-06T17:22:28.571Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><blockquote>JSON is a widely used data-interchange format commonly used in web applications, one example being REST APIs requests &amp; responses. This blog will walk readers through which MariaDB version supports JSON datatype, how to upgrade from MariaDB from 10.1.x to 10.2.x, and finally, some hands-on practice using a JSON data type with simple SQL queries using MySQL console.</blockquote><p><strong>Which MariaDB version supports JSON data type?</strong></p><p>MariaDB 10.2.7 added the JSON alias for LONGTEXT, introducing more compatibility with MySQL’s JSON data type. MariaDB implements this as a LONGTEXT to avoid the JSON data type contradicting SQL standard, plus MariaDB’s benchmarks indicate that performance is at least equivalent.</p><p>To ensure that a valid JSON document is inserted, the JSON_VALID function can be used as a CHECK constraint. This constraint automatically includes all types using the JSON alias from MariaDB 10.4.3.</p><p>Steps to upgrade from MariaDB 10.1.x to 10.2.x:</p><ol><li>vi /etc/yum.repos.d/MariaDB.repo</li><li>Change the <strong>baseurl </strong>from 10.1 to 10.2 as shown below:</li></ol><pre>[mariadb]</pre><pre>name = MariaDB</pre><pre>baseurl = <a href="http://yum.mariadb.org/10.2/centos7-amd64">http://yum.mariadb.org/10.2/centos7-amd64</a></pre><pre>gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB</pre><pre>gpgcheck=1</pre><p>3. Remove the old version of MariaDB with the command below:</p><pre>sudo yum remove MariaDB-server</pre><p>4. Install the most common packages, execute the following command:</p><pre>sudo yum install MariaDB-server galera MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common</pre><p>5. MariaDB’s systemd service can be configured to start at boot by executing the following:</p><pre>sudo systemctl enable mariadb.service</pre><p>6. MariaDB’s systemd service can be started by executing the following:</p><pre>sudo systemctl start mariadb.service</pre><p>7. In case you see <strong>too many connection errors</strong>. Add the line below in file <strong>/etc/my.cnf.d/server.cnf</strong></p><pre>[mysqld]</pre><pre>max_connections = 1500</pre><p>8. Verify you can log in and perform DB operations via MySQL console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*5bDST50aB-R9FkHmar9zyQ.png" /></figure><p><strong>Using JSON data types in MariaDB 10.2.37</strong></p><ol><li>Without JSON validation:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*PjZOFKiZSFNvM0fN4lEo7g.png" /></figure><p>2. With JSON Validation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*AxFqiEKO7yliklyk9Nvq4A.png" /></figure><p><strong>Summary</strong>:</p><blockquote>This blog walked you through JSON datatype support in MariaDB 10.2.x support, how to upgrade from MariaDB from 10.1.x to 10.2.x, and provided readers with a hands-on opportunity to use JSON data type with and without validation on JSON data type along with simple SQL queries using MySQL console.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KGSL-aC8eTH0yEQ5Dszciw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dffae7d4938" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/json-data-type-support-in-mariadb-10-2-x-5dffae7d4938">JSON Data Type Support in MariaDB 10.2.x</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Troubleshooting High CPU and Memory Leaks in Java Processes]]></title>
            <link>https://medium.com/zaloni-engineering/troubleshooting-high-cpu-and-memory-leaks-in-java-processes-fa962775351d?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa962775351d</guid>
            <category><![CDATA[memory-leak]]></category>
            <category><![CDATA[linux-commands]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[high-cpu]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Amar Gurung]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 18:26:54 GMT</pubDate>
            <atom:updated>2021-04-22T18:36:07.900Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>A common problem encountered in any Java application is high CPU utilization and memory leaks. The general solutions are either killing the process by starting all over again or increasing the heap size. For this recurring problem, the only way to get rid of it entirely is to identify the threads of a Java Process over-consuming CPU and find the root cause of the problem. This article will guide you through the basic steps to troubleshoot the given problem on a Linux machine and identify memory leaks, if any, using the Memory Analyzer plugin of Eclipse IDE.</p><h3>Why do Java Applications consume high CPU?</h3><p>Java applications may utilize high CPU resources for several reasons; some reasons are listed below:</p><ul><li>Poorly designed application code with inefficient loops, for example, recursive method calls or poor usage of collections.</li><li>Insufficient memory in JVM can also reflect high CPU usage, leading to more time spent in Garbage Collection.</li><li>A JVM can show high CPU usage due to incoming workload. The server capacity may not be enough to handle the incoming requests, in which case the Java application may be functioning and trying to keep up with the workload.</li></ul><h3>Challenges</h3><p>The key challenge to troubleshoot high CPU and memory leaks is to find the right set of tools and Linux commands.</p><p>A list of some common tools and commands are as follows:</p><ul><li><strong>jmap</strong> for memory footprint.</li><li><strong>jstack</strong> for thread dump.</li><li><strong>top</strong> for CPU and memory utilization preview.</li><li><strong>jvisualvm</strong> (open source) and jprofiler (licensed) tools for monitoring application, memory footprint, thread dump, etc</li><li><a href="https://fastthread.io/">https://fastthread.io/</a> — online tool for thread dump analysis.</li><li><strong>Memory Analyzer </strong>eclipse plugin for memory footprint.</li></ul><h3>Troubleshooting Guide</h3><ol><li>Identity the Java Process that consuming a high CPU. The <strong>top </strong>is the general Linux command to achieve this task. The following screenshot reveals that PID <strong>53984 </strong>has maximum CPU usage i.e. 1024.3</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/0*B35McO3a1pV4ZC2P" /></figure><p>2. After identifying the Process ID, the next step is to list down the child threads for PID <strong>53984 </strong>using the top command shown below.</p><p>top -n 1 -b -H -p &lt;<strong>pid</strong>&gt; &gt; &lt;output location&gt;</p><p>where</p><p><strong>-n</strong> no. of iterations</p><p><strong>-b </strong>batch-mode operation</p><p><strong>-H </strong>thread mode</p><p><strong>-p </strong>process id</p><p>Sample<strong> output </strong>of the above command.</p><p>53990 hadoop 20 0 32.3g 18g 73m R 94.8 15.3 464:51.36 java</p><p>53991 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:58.08 java</p><p>53992 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:51.82 java</p><p>53993 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:58.51 java</p><p>53994 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:59.24 java</p><p>53995 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:50.42 java</p><p>53996 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:56.86 java</p><p>53997 hadoop 20 0 32.3g 18g 73m R 92.9 15.3 465:01.49 java</p><p>53998 hadoop 20 0 32.3g 18g 73m R 90.9 15.3 464:55.99 java</p><p>3. Convert the first column PIDs to hexadecimal values. The converted values are shown within the parenthesis below:</p><p>53990(<strong>0xd2e6</strong>) hadoop 20 0 32.3g 18g 73m R 94.8 15.3 464:51.36 java</p><p>53991(<strong>0xd2e7</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:58.08 java</p><p>53992(<strong>0xd2e8</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:51.82 java</p><p>53993(<strong>0xd2e9</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:58.51 java</p><p>53994(<strong>0xd2ea</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:59.24 java</p><p>53995(<strong>0xd2eb</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:50.42 java</p><p>53996(<strong>0xd2ec</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 464:56.86 java</p><p>53997(<strong>0xd2ed</strong>) hadoop 20 0 32.3g 18g 73m R 92.9 15.3 465:01.49 java</p><p>53998(<strong>0xd2ef</strong>) hadoop 20 0 32.3g 18g 73m R 90.9 15.3 464:55.99 java</p><p>4. Next, we capture the jstack of the parent process id (<strong>53984), </strong>as shown below, and look up the hex values listed in step 3 with parent PID’s jstack file to identify the child threads consuming high CPU.</p><p>Sample output of command <strong><em>jstack 53984 &gt; 53984.txt</em></strong></p><p>“VM Thread” os_prio=0 tid=0x00007fccac09e800 nid=0xd2f3 runnable</p><p>“GC task thread#0 (ParallelGC)” os_prio=0 tid=0x00007fccac032800 nid=0xd2e6 runnable</p><p>“GC task thread#1 (ParallelGC)” os_prio=0 tid=0x00007fccac034800 nid=0xd2e7 runnable</p><p>“GC task thread#2 (ParallelGC)” os_prio=0 tid=0x00007fccac036000 nid=0xd2e8 runnable</p><p>“GC task thread#3 (ParallelGC)” os_prio=0 tid=0x00007fccac038000 nid=0xd2e9 runnable</p><p>“GC task thread#4 (ParallelGC)” os_prio=0 tid=0x00007fccac03a000 nid=0xd2ea runnable</p><p>“GC task thread#5 (ParallelGC)” os_prio=0 tid=0x00007fccac03b800 nid=0xd2eb runnable</p><p>“GC task thread#6 (ParallelGC)” os_prio=0 tid=0x00007fccac03d800 nid=0xd2ec runnable</p><p>“GC task thread#7 (ParallelGC)” os_prio=0 tid=0x00007fccac03f000 nid=0xd2ed runnable</p><p>“GC task thread#8 (ParallelGC)” os_prio=0 tid=0x00007fccac041000 nid=0xd2ee runnable</p><p>“GC task thread#9 (ParallelGC)” os_prio=0 tid=0x00007fccac043000 nid=0xd2ef runnable</p><p>5. The threads identified in step 4 will be called the <strong>ParallelGC </strong>threads. These threads perform Garbage collection but cannot reclaim heap memory that is causing high CPU utilization.</p><p>6. The next step is to collect the heap dump of the PID <strong>53984. </strong>This is achieved by using the following Linux command:</p><p><em>jmap -dump:live,format=b,file=heap.bin </em><strong><em>53984 </em></strong><em>&gt; 53984_heap</em></p><p>7. Analyze the 53984_heap<strong> </strong>file using the Memory Analyzer plugin which can be installed from Eclipse’s Marketplace (Navigate to <strong>Help </strong>option then select <strong>Eclipse Marketplace</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/0*jkniCLMk_UDIio9g" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*xHtXfiVcZ3o6hhQ0" /></figure><p>8. The following are screenshots of the memory leak report corresponding to PID <strong>53984</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*-BUY1CgfyZo7eXxP" /></figure><h3>Observations</h3><ul><li>Approx. <strong>4.4 GB</strong> heap space is consumed by stale instances of java.net.FactoryURLClassLoader.</li><li><strong>Parallel GC threads</strong> consume high CPU time from jstack file (<strong><em>53984.txt)</em></strong>, which implies that GC is not functioning properly for those stale objects in heap space.</li></ul><h3>Solutions</h3><p>A few short-term solutions for memory leaks include increasing the heap space. This solution can postpone the issue for a while, but it might reappear if the load to Java Process is high.</p><p>Some of the promising approaches are to do a deep dive into the source code of the Java application and identify the areas that are causing stale instances in heap memory.</p><h3>Conclusion</h3><p>In conclusion, this article walks readers through:</p><ul><li>Potential reasons why Java Process consumes high CPU</li><li>A troubleshooting guide to resolve the issue</li><li>List of some common tools used for given solutions</li><li>Linux commands to debug</li><li>How to correlate high CPU with a memory leak</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa962775351d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/troubleshooting-high-cpu-and-memory-leaks-in-java-processes-fa962775351d">Troubleshooting High CPU and Memory Leaks in Java Processes</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Splunk Integration and Monitoring with Zaloni’s DataOps Platform, Arena]]></title>
            <link>https://medium.com/zaloni-engineering/splunk-integration-and-monitoring-with-zalonis-dataops-platform-arena-e90103d6ec3f?source=rss----ca51b078b7a9---4</link>
            <guid isPermaLink="false">https://medium.com/p/e90103d6ec3f</guid>
            <category><![CDATA[application-monitoring]]></category>
            <category><![CDATA[log-monitoring]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[apm]]></category>
            <category><![CDATA[log-analysis]]></category>
            <dc:creator><![CDATA[Ajinkya Rasam]]></dc:creator>
            <pubDate>Wed, 14 Apr 2021 19:13:09 GMT</pubDate>
            <atom:updated>2021-04-14T19:14:09.639Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This technical blog is discussing Splunk Integration with Zaloni’s Arena platform. Note that these integration instructions will work with any Java Virtual Machine (JVM).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQvmaZAP_uisJgNV" /><figcaption>Photo by <a href="https://unsplash.com/@campaign_creators?utm_source=medium&amp;utm_medium=referral">Campaign Creators</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Overview</h3><p>With the ever-increasing number of virtual machines and applications, it becomes difficult to monitor their performance, availability and provide proper error troubleshooting in one place. It’s important to <em>herd the cats, </em>to ensure smooth functioning of day-to-day business activities and quick troubleshooting to make it up to RTO (Recovery Time Objective) goals. This can be easily achieved using APM (Application Performance Management) or a log aggregation tool such as Splunk. We will use a microservice-based application called “<a href="https://www.zaloni.com/arena-overview/">Arena</a>” for our use case.</p><blockquote>Arena was formerly known as ZDP. Therefore, these terms are interchangeable to an extent.</blockquote><p>Splunk can be utilized in different ways to monitor Arena’s health, raise alerts when critical incidents occur and also monitor aggregated logs produced by Arena’s microservices. This document talks about Arena health metrics, logs and ports which can be monitored using Splunk and how to set it up. We will set up 2 applications:</p><ol><li><strong><em>Splunk Server:</em></strong> used for monitoring, creating dashboards, querying logs and performing analytics.</li><li><strong><em>Universal forwarder: </em></strong>used to forward logs to Splunk server for aggregation.</li></ol><p>For detailed instructions on setup, please see: <a href="https://docs.google.com/document/d/1NEeu4eV34Ua_f-Ik_ouXlHkCymoNuy3eqVsOtscgJNw/edit#heading=h.mmavqkfuhv2b">Setting up Splunk Enterprise server</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8hAubXBD9TvjdsPwD4UaQ.png" /></figure><h3>Monitoring Metrics</h3><p>This section talks about recommended Arena metrics to monitor using not only Splunk but any application monitoring software.</p><h4>JVM Monitoring</h4><p>Arena consists of 13 microservices, most of them, <em>except ZDP-Kibana,</em> spins up a java (JVM) process on startup to which a JVM monitoring agent can be attached. Steps to configure the JVM agent are documented in the JVM monitoring setup section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*bq8CeTKUnNNH80UwnlUIPg.png" /></figure><h4>Log Aggregation</h4><p>The Arena application has 13 microservices that write logs to their respective directories. Below is a list of service names along with their default log directories. This can be configured to forward logs to the Splunk server using the Splunk universal forwarder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*yHN8kVCR-3ePF-5KABnqwQ.png" /></figure><h4>Port Monitoring</h4><p>Additionally, one can monitor ports to ensure that these services listen in order to check the liveliness of the service. Below is a list of default ports Arena services listen to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Pi0qX_AS-y72zCp7yZykZA.png" /></figure><h3>Setting up Splunk Enterprise server</h3><ol><li>Download Splunk for OS:<br><a href="https://www.splunk.com/en_us/download.html">https://www.splunk.com/en_us/download.html</a></li></ol><p>2. Untar Splunk package:</p><pre><em>sudo tar -xvzf splunk_package.tgs — C /opt/<br></em>cd /opt/splunk/bin<br>export SPLUNK_HOME=/opt/splunk/</pre><p>3. Start Splunk server</p><pre>./splunk start — accept-license</pre><p>6. Create username and pass. This will be used to login to Splunk portal</p><p>7. Splunk portal URL will be displayed at the end of server start</p><h3>Setting up Universal Forwarder</h3><p>Universal forwarder should be installed on all nodes which have Arena microservices running. It will monitor Arena log directories and continuously send o/p to the Splunk server for aggregation. Additionally, to monitor JVM metrics, we need to install a Splunk JMX add-on. You can follow the instructions in this <a href="https://www.splunk.com/en_us/resources/videos/splunk-education-getting-data-in-with-forwarders.html">video</a> or follow the steps below:</p><h4>Open port on Splunk server to listen to the forwarder:</h4><ol><li>Goto Splunk server URL</li><li>Goto Setting &gt; Forward and receiving</li><li>Select Add new in receiving</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eCUezHXhmg2h4ksc" /></figure><p>4. Specify which tcp port server should listen on. Ensure the port is empty using the command:</p><pre><em>sudo netstat -tunlp | grep &lt;port num&gt;</em></pre><p>5. Goto Settings &gt; server control &gt; restart server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*comDeOZm8F3xqOL6" /></figure><p>6. Create a separate index in Splunk for Arena. You can do that by going to Settings &gt; Indexes &gt; Add new index on Splunk server. This index will be used to forward all logs related to Arena.</p><h4>Download and install Universal forwarder</h4><p><em>This needs to be performed on all nodes where Arena services are running.</em></p><ol><li>Download Splunk forwarder (Preferably tar file): <a href="https://www.splunk.com/en_us/download/universal-forwarder.html">https://www.splunk.com/en_us/download/universal-forwarder.html</a></li><li>Place tar file on Arena node</li><li>Install and start the forwarders using the commands below:</li></ol><pre><em>sudo tar xzvf splunkforwarder.tgz -C /opt/<br>cd /opt/splunkforwarder/bin/<br>sudo ./splunk start — accept-license<br>sudo ./splunk enable boot-start</em></pre><p>4. Change forwarder credentials:</p><pre><em>sudo ./splunk edit user admin -password &lt;pass&gt; -role admin -auth admin:changeme</em></pre><h4>Configure forwarder to send data to Splunk server</h4><ol><li>Command:</li></ol><pre>sudo ./splunk add forward-server &lt;splunk-server-host&gt;:&lt;configured port&gt; -auth &lt;forwarder_username&gt;:&lt;forwarder_pasword&gt;</pre><p>2. Add log directories to forwarder which needs to be sent to Splunk server</p><pre>sudo .<em>/splunk add monitor /var/log/&lt;service_name&gt;/ -index ZDP -sourcetype &lt;service_name&gt; -auth user:pass</em></pre><ol><li>From the Splunk server, you can now query using the hostname of the forwarder to see log data</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p22Ic9HrwBwGD80t" /></figure><p>To list all forwards:</p><pre><em>sudo ./splunk list forward-server -auth user:pass</em></pre><h3>Using Addon: Monitoring of Java Virtual Machines with JMX</h3><p>To monitor JVMs, we need to install a plugin called “JMX.” Click on “Find More Apps” and search “Monitoring of Java Virtual Machines with JMX.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a_GgHoRp20mKHC5j" /></figure><h4>How to Configure an agent with ZDP-services</h4><p>The example below shows how to configure a zdp-gateway with the JMX monitoring agent. However, this can be extended to configure the rest of Arena services, except zdp-Kibana. The only difference would be in the way they are set.</p><ol><li>Stop zdp-gateway service</li></ol><pre>sudo systemctl stop zdp-gateway</pre><p>2. Open /etc/sysconfig/zdp-gateway</p><p>3. Add the below properties to conf file.</p><pre>JAVA_OPTS=&quot;$JAVA_OPTS<br><strong><em>-Dcom.sun.management.jmxremote.port=&lt;portNum&gt; \</em></strong></pre><pre><strong><em>-Dcom.sun.management.jmxremote.authenticate=false\</em></strong></pre><pre><strong><em>-Dcom.sun.management.jmxremote.ssl=fals</em>e</strong>&quot;</pre><blockquote><strong>portNum</strong><em> </em>is the port number through which you want to enable JMX/RMI connections. Be sure to specify an unused port number.</blockquote><p>For simplicity, authentication and ssl are disabled. It’s enabled by default and instructions to set it up are in this <a href="https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote">oracle doc</a>.</p><p>4. On Splunk host server node edit</p><pre>$SPLUNK_HOME/etc/apps/SPLUNK4JMX/bin/config/config.xml</pre><p>5. Set property:</p><pre>&lt;jmxserver host=”&lt;JVM_host&gt;” jvmDescription=”zdp-gateway_node_2&quot; jmxport=”&lt;port configured&gt;”&gt;</pre><p>For the rest of Arena services please use the properties below, if java_opts already have some value, you can append these properties. Config files will be located at /etc/sysconfig/&lt;service_name&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*yL5ipWw44WxHCrbNOPB5MA.png" /></figure><h4>Activating JMX Add on</h4><ol><li>Add data and chose JVM Addon</li><li>Get 7-day activation key from <a href="https://www.baboonbones.com/#activation">https://www.baboonbones.com/#activation</a></li><li>Enable the data source status</li></ol><p>Enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OvTRzxWv0hb2FAL6" /></figure><h3>Arena log analysis configuration</h3><p>Splunk provides different dashboard design options to keep an eye on the performance of Arena VM’s. In this section we will walk you through some examples of setting up reports, performing analysis, and setting up a notification alert system.</p><p>This section assumes that you have set up the Splunk forwarder in all nodes where Arena services are running using the step mentioned above in section: <a href="https://docs.google.com/document/d/1NEeu4eV34Ua_f-Ik_ouXlHkCymoNuy3eqVsOtscgJNw/edit#heading=h.ypd7trbbbblt">Setting up Universal Forwarder</a></p><ol><li>Open Splunk enterprise server URL and select search &amp; reporting</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9X0eyBX1NjjD0iqq" /></figure><p>2. In the query window, use index=“&lt;arena_index_name&gt;”. We have used replica2 as index name for Arena logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*skJ3ZIQtLevNJlrS" /></figure><p>3. You can also add keywords such as `Error` OR `Exception` to search for related entries in logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A4ScHk7QIiKcVP6E" /></figure><p>4. If you want to narrow down logs for specific zdp-service. Use sourcetype=&lt;service_name&gt; in query. This property is created when you run add monitor command on the Splunk forwarder node.</p><p>5. Click on Patterns to automatically detect frequently occurring error patterns. Further, you can create a trigger and specify an action when similar errors occur in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yBgkiLg0wgSo-tKZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f_80YL-7IHzGaQoG" /></figure><p>There are multiple options for action to be taken after an error occurs, such as running script, sending email, or even a webhook call. So, play around!</p><h3>Troubleshooting</h3><blockquote>error “Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.11.13.116”</blockquote><p><strong>Resolution:</strong></p><p>ZDP-gateway was not coming up due to which port 8090 was not available.</p><p>In ZDP /etc/zdp-gateway/zdp-gateway-5.0.2-FINAL.conf modified the JAVA_HOME from #JAVA_HOME=“/usr/java/jdk1.8.0_202-amd64/jre”</p><p>to JAVA_HOME=“/usr/java/jdk1.8.0_202-amd64&quot;</p><p>ZDP-gateway was up and running now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e90103d6ec3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zaloni-engineering/splunk-integration-and-monitoring-with-zalonis-dataops-platform-arena-e90103d6ec3f">Splunk Integration and Monitoring with Zaloni’s DataOps Platform, Arena</a> was originally published in <a href="https://medium.com/zaloni-engineering">Zaloni Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>