<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harshil Shah on Medium]]></title>
        <description><![CDATA[Stories by Harshil Shah on Medium]]></description>
        <link>https://medium.com/@shaharshil2001?source=rss-761021776977------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*z1lQsXitOinP5nRMAheRfw.jpeg</url>
            <title>Stories by Harshil Shah on Medium</title>
            <link>https://medium.com/@shaharshil2001?source=rss-761021776977------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 07:42:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shaharshil2001/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating ansible role for configuring httpd webserver and HAProxy load-balancer.]]></title>
            <link>https://shaharshil2001.medium.com/creating-ansible-role-for-configuring-httpd-webserver-and-haproxy-load-balancer-fd19ed2c6052?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd19ed2c6052</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[haproxy]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[roles]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Sun, 28 Mar 2021 17:54:31 GMT</pubDate>
            <atom:updated>2021-03-28T18:27:11.936Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating separate roles for configuring apache webserver and HAProxy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*xmg3qVSN4NUx-pv3SZ8VBQ.png" /><figcaption>credits : source</figcaption></figure><p>I have already created an article where in I have configured HAProxy without using ansible roles. You can refer to it for better understanding.</p><p><a href="https://shaharshil2001.medium.com/configuring-haproxy-using-ansible-on-vm-and-on-aws-cloud-a55027fbf19f">Configuring Haproxy using Ansible on VM and on AWS cloud</a></p><blockquote><strong>github link</strong> : <a href="https://github.com/iamShahHarshil/ansible-role">https://github.com/iamShahHarshil/ansible-role</a></blockquote><h3>What is Ansible Role :</h3><p>In real world the plays might be long and complex, with many included or imported files, and with tasks and handlers to manage various situations. Copying all that code into another playbook might be difficult.</p><p>Ansible roles provide a way to make it easier to reuse ansible code generically. You can package, in a standardized directory structure, all the tasks, variables, files, templates and other resources needed to provision infrastructure or deploy application or configure a service. We can copy that role project to project simply by copying the directory. You can than simply call that role from a play to execute it.</p><h4>Ansible role have following benefits :</h4><p>→ Roles groups content, allowing easy sharing of code with others.</p><p>→ Roles can be written that defines the essential elements of a system type: web server, database server, git repository or other purpose.</p><p>→ Roles make larger projects more manageable.</p><p>→ Roles can be developed parallel by different administrator.</p><p><strong><em>Ansible Galaxy provides pre-packaged units of work known to Ansible as roles and collections.</em></strong></p><h4>Now steps to create our role.</h4><p>→ First creating role for <strong>webserver</strong> and <strong>haproxy</strong>.</p><blockquote>ansible-galaxy role init webserver</blockquote><blockquote>ansible-galaxy role init haproxy</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*S6irKXvJQUCUlEnWw_dOSg.png" /></figure><p>Files inside a role folder are as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*1OmhX76o8NIYaniE1VGXrQ.png" /></figure><p>Now we will update the inventory file and mention the path to folder where all roles are present. I have created both roles in following directory:</p><blockquote>/root/ws2/roles/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*siPqL6CZQIbYSqxVFXLiEA.png" /><figcaption>ansible.cfg file</figcaption></figure><p>Now go to main.yml file inside webserver role as shown below 👇🏼 and edit main.yml file. Here main.yml file is already created for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*lfLysIuJ0HZvoxUf-rf61A.png" /></figure><p>Now I will change this playbook and add code to configure httpd server. 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*YQTsxO0uy9Gj3DQ4gXyW7A.png" /><figcaption>main.yml</figcaption></figure><p><strong>/files</strong></p><p>Now changing directory to <strong>/files</strong> → This directory contains all extra files that we imported in our main.yml playbook. Like in our webserver’s main.yml playbook, we are copying a file, <strong>index.php</strong> , so we will store this file in <strong>/files</strong> directory. since ansible is using role, it will by default look for all files in this location.</p><p>I am using a very simple php file to copy where output will be target node’s IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*h10kpq4sKGhvoMYK8s88Cg.png" /><figcaption>index.php</figcaption></figure><p>Here configuration for webserver is done.</p><h4>Now configuring Haproxy.</h4><p>Code in main.yml file 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*FlitFCV6AAMbKoBqnLREdw.png" /></figure><p><strong>/templates</strong></p><p>Adding the <strong>haproxy.cfg.j2</strong> jinja template in <strong>/templates</strong> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*Kxa9nsCP_BDKjCYgTmkFFw.png" /></figure><p>Content in haproxy.cfg.j2 file 👇🏼.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_2CIC5oaKpEi2LL9etGyQ.png" /></figure><p><em>I have explained about this in the article whose link I have provided in the beginning.</em></p><p>Since I have used a variable in my template file → <strong>port_no</strong>, I will have to modify main.yml file located in /vars directory inside haproxy role directory. i.e 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*Qz0Tk1qfymnw5DlXyrgh0A.png" /><figcaption>/root/ws2/roles/haproxy/vars</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*q2N65UZppZy09WUrVlh4Yg.png" /><figcaption>inside main.yml</figcaption></figure><p>Now that both the roles are configured, its time to combine them into a single playbook file → <strong>setup.yml </strong>(you can give any name). For this, create a playbook in same role folder where both the roles are present. 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*6cUxn54m4PbRS1YLJpWLUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*Yu34BuVguv2avKIbBgqiHQ.png" /><figcaption>setup.yml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*d6y8gy-kY6HTPKx8BF-bNA.png" /></figure><p><strong><em>You need minimum 2 servers running in background for haproxy to work. It will not work If there is only one server running.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*weNKbOH6BQH_DE-yxNF16A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHSrIfEKv3wP9xkTo-cQqg.png" /></figure><p>Playbook is ran successfully. Now let’s see output in windows OS in chrome browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*A7DeJUYcU1m3IMvMFDp2XA.png" /></figure><p><em>So finally Our work here is done</em> ✨👍🏼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd19ed2c6052" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring target node using only variable name same as OS_name.]]></title>
            <link>https://shaharshil2001.medium.com/configuring-target-node-using-only-variable-name-same-as-os-name-d320006c81d2?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/d320006c81d2</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Sat, 27 Mar 2021 17:01:58 GMT</pubDate>
            <atom:updated>2021-03-27T17:01:58.517Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating an Ansible Playbook which will dynamically load the variable file named same as OS_name and just by using the variable names we will Configure our target node.( Note: No need to use <strong>when</strong> keyword here. )</p><p>In different OS, software name is different. For example, web server software name in RedHat Linux is <strong><em>httpd</em></strong>, while same software’s name in Ubuntu OS will be <strong><em>apache2. </em></strong>So will use ansible facts in combination with variables to configure dynamically in both OSs with same playbook.</p><p>Note: This practical I have performed on AWS cloud instances. I have launched three instances.</p><ol><li>Ansible manage node. → <strong>Amazon Linux OS</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVvkDJ8Bs9MntREdCo6KNA.png" /></figure><p><strong>2</strong>. Target node → <strong>RedHat Linux OS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjztnAZLdXch4hASGeXNuA.png" /></figure><p><strong>3</strong>. Target node → <strong>Ubuntu OS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i04zUrN0fj45c2ZPq5cxMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AzkS-ROJj26zIgaCeZvpQ.png" /></figure><p>Now I have already installed and configured ansible in my controller node. You can refer to below article if you haven’t already configured ansible 👇🏼</p><p><a href="https://shaharshil2001.medium.com/configuring-haproxy-using-ansible-on-vm-and-on-aws-cloud-a55027fbf19f">Configuring Haproxy using Ansible on VM and on AWS cloud</a></p><p>→ <strong>Inventory file 👇🏼 :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExKLMacDkmoUvxLwwcrLRA.png" /></figure><p>→ Checking the connectivity with both target nodes 👇🏼 Looks good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*ObeJQJ8Aik-cxD8M1mk3bA.png" /></figure><p>Creating two variable files having name same as target node’s OS name.</p><p>Like when I ran ansible command of setup module for target node having IP → 13.213.4.183 👇🏼</p><blockquote>ansible 13.213.4.183 -m setup</blockquote><p>than I found that the OS distribution name is <strong>RedHat</strong> 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*OnMkf6cd6s06dwD2TEKc8Q.png" /></figure><p>So I will create a variable file having same name as this →<strong> RedHat.yml</strong></p><p>And it will contain a variable named <strong>software</strong>, having value → <strong>httpd</strong>. Since RedHat OS supports this software 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*jVAWT41PdJPNuW8HkQn0QQ.png" /></figure><p>Similarly running setup module for ubuntu OS, the OS distribution name is <strong>Ubuntu</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*9Maj6OuBTOei_0OEdld9kQ.png" /></figure><p>So I will create a variable file having same name as this →<strong> Ubuntu.yml</strong></p><p>And it will contain a variable named <strong>software</strong>, having value →<strong> apache2</strong>. Since Ubuntu OS supports this software 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*H9vJGOFTDfDn4v4I_4aOuA.png" /></figure><p>Now creating main playbook and running it. <strong>multipleos.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*VhwOJv99Sq50p9Q36SzXvA.png" /></figure><p>Running the playbook:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqFs3vzm5x8XAimZWFrkHw.png" /></figure><p>playbook is ran successfully.</p><p>Now checking if apache web server is successfully installed and started in both systems. i.e RedHat and Ubuntu.</p><p>First checking in <strong>Ubuntu</strong> 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u35cm7LkVl15hL-6l0qx0g.png" /></figure><p>Now in <strong>RedHat</strong> OS 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inLtOIa5vyBGCWIR_AwdRA.png" /></figure><p>Web server is successfully running. Now I will quickly try and connect to both web servers. As we know, web server by default listens on port number 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*M45IDL0JRip1TekYdLliWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*CBrax8AGg9cY9EWDiJEYFQ.png" /><figcaption>(Left image) Ubuntu and (right image) RedHat</figcaption></figure><p>My php code for demo web-page 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*hZ26OsTReaxHud4JimUK6A.png" /></figure><p><em>That is it for this article. See you all in next one</em> 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d320006c81d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a custom network topology.]]></title>
            <link>https://shaharshil2001.medium.com/creating-a-custom-network-topology-ca63b28ca409?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca63b28ca409</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[network-topology]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <category><![CDATA[network-architecture]]></category>
            <category><![CDATA[arth]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Sat, 27 Mar 2021 14:57:02 GMT</pubDate>
            <atom:updated>2021-03-27T14:57:02.289Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating a network Topology Setup in such a way so that System A can ping to two Systems, System B and System C but both these systems should not be able to ping each other without using any security rule e.g. firewall etc.</p><p>You can refer to one of my article regarding network setup by below link 👇🏼</p><p><a href="https://shaharshil2001.medium.com/explaining-a-setup-where-you-can-ping-google-but-not-facebook-from-same-machine-87f4363637b8">Explaining a setup where you can ping google but not facebook from same machine.</a></p><p>In this article I will use three systems, system A,B and C. Where system A can ping both systems but system B and C can not ping each other. In other words, system A has connectivity to both B and C, but B and C does not have connectivity with each other.</p><p>System A’s IP address is → 192.168.1.11</p><p>System B’s IP address is → 192.168.1.14</p><p>System C’s IP address is → 192.168.1.15</p><blockquote><strong>Note:</strong> I will change IPs of all three systems just for sake of current practical.</blockquote><blockquote>System A’s details and it’s route table 👇🏼</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*M26_3U6wrJf05zueCnTZ5w.png" /></figure><p>Changing IP of system A to 192.168.1.1</p><p>And adding new and only network rule to route table</p><blockquote>route add -net 192.168.1.0/24 enp0s3</blockquote><blockquote>System B’s details and it’s route table 👇🏼</blockquote><p>changing it’s IP to <strong>192.168.1.4</strong> and adding new rule to route table that can only ping to system A</p><blockquote>route add -net 192.168.1.0/31 enp0s3</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*xqu8VFiOA7Jq-cZh11-OmQ.png" /></figure><blockquote>System C’s details and it’s route table 👇🏼</blockquote><p>changing it’s IP to <strong>192.168.1.5</strong> and adding new rule to route table that can only ping to system A</p><blockquote>route add -net 192.168.1.0/31 enp0s3</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*lSLI-DjCwuzwRvzu5P8Dng.png" /></figure><p>Now let’s ping system A-B and vice versa. Left image shows connection from A → B and right image shows connection from B → A. 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*eMC82jIRqcEHqOxx9rF2Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*7l_Hy475aO7rQv0A2eE5jA.png" /><figcaption>(left image) - A →B and (right image) - B →A</figcaption></figure><p>Now let’s ping system A-C and vice versa. Left image shows connection from A → C and right image shows connection from C→ A. 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*4Hdp-LDtWvfut9aS0zZgsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*hJpF_bX5_AOhmOkTvYcYOw.png" /><figcaption>(left image) — A →C and (right image) — C→A</figcaption></figure><p>Now let’s ping system B and C with each other 👇🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*CcUl5tpKyP4KHO1-qd3-3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*LUZR79uuR1dzqH7HWBx3QA.png" /><figcaption>B →C (left image) | C →B (right image)</figcaption></figure><p>So here as you can see B and C systems are unable to connect to each other but are able to connect to system A individually.</p><p><strong><em>So finally we have achieved following network topology 👇🏼</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*S63xzpaFGRvruutq_5PpTw.png" /></figure><p><em>Thank you for reading. Hope you learned something new </em>👍🏼😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca63b28ca409" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Haproxy using Ansible on VM and on AWS cloud]]></title>
            <link>https://shaharshil2001.medium.com/configuring-haproxy-using-ansible-on-vm-and-on-aws-cloud-a55027fbf19f?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/a55027fbf19f</guid>
            <category><![CDATA[ansible-playbook]]></category>
            <category><![CDATA[haproxy]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <category><![CDATA[arth]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 16:48:29 GMT</pubDate>
            <atom:updated>2021-03-26T17:16:14.455Z</atom:updated>
            <content:encoded><![CDATA[<p>configuring reverse proxy on linux OS using ansible, first on oracle VM and than on AWS cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n55PHP2L4HOu0H1EM2sIDQ.png" /></figure><blockquote><strong>Github repo link</strong> → <a href="https://github.com/iamShahHarshil/haproxy-with-ansible">https://github.com/iamShahHarshil/haproxy-with-ansible</a></blockquote><p>Haproxy is a software of program that we will use to configure reverse proxy and Load-Balancer for Apache web server</p><h4>Configuring Haproxy is a 3 step process.</h4><ol><li>We will install haproxy program on the node that we want working as load balancer.</li><li>We will edit config file of haproxy.</li><li>start haproxy service.</li></ol><p>We can do all steps manually, but since this article is to show hot to do using ansible, we will take help of ansible.</p><h4>Step-1 Install service</h4><p>with use of package module we will install haproxy service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*mH_yMazMlrkkCpnibjF9zw.png" /></figure><h4>Step-2 Edit config file</h4><p>haproxy’s config file is located at loaction → <strong>/etc/haproxy/haproxy.cfg</strong></p><p>So we need this file in target node that is supposed to act as load balancer. Using copy command of linux, we first copy this file to the directory where our playbook is currently located.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VWqvBEVyssvgqrjXut5dhw.png" /></figure><p>Above image shows how haproxy.cfg file looks like. The first highlighted part that you can see,</p><blockquote>bind *:8080</blockquote><p>is port for frontend. So when client connects to load balancer, it uses port number 8080. We can change port number to any value ranging between 0–2¹⁶ . So if client wish to connect to a web app or website, than it will type in browser → <a href="http://www.example.com:8080,">www.example.com:8080,</a> so client will be directed to load balancer. Client will never connect to web server directly.</p><p>Now load balancer will connect to different webserver (one at a time) and distribute the load. This part in haproxy.cfg file comes under the section highlighted as<strong><em> backend app.</em></strong></p><p>The IPs you see in the red box are IPs of different web server.</p><p>So finally we will have to copy this file after editing and save it in same location as → <strong>/etc/haproxy/haproxy.cfg</strong> , in target node(load balancer node).</p><p>But the problem is, whenever new webserver come online, we manually have to edit haproxy.cfg file and add IPs of these webservers under <strong>backend app</strong> section. And to overcome this problem we have to kind of bring intelligence to this.</p><h4>Jinja:</h4><p>Using jinja we can overcome this problem. Jinja is a modern and designer friendly templating language for python, modelled after Django templates. Jinja is basically an engine used to generate HTML or XML returned to the user via an http response.</p><p>Being a python library, jinja requires python to run and expose the features.</p><p>copy module we use in ansible, will not parse the data which it copies, whereas template module does. For copy module, everything is a string, whereas we need to tell the template module that which are the variables, loops, conditions, etc inside the file.</p><p>{{ }} → whatever is inside this curly braces, template module will process it and give the value of it. Behind the template module, ansible use keywords like {{, }}, #, etc. and this keywords comes from a framework known as <strong><em>jinja</em></strong>.</p><p>So once you copy file to the directory where our playbook is located, we will edit this file using jinja.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-CEJsHvyvMKk9Z5AqNZIQ.png" /></figure><p>As you can see I have made this file more dynamic by first replacing frontend port no. with some variable. So we just have to change value of this variable in playbook and again run the playbook, so port no. will be changed.</p><p>Second, the red box you see at the end, contains a for loop written with jinja syntax. This loop will go to inventory file, take the first ip from under host group name → “webserver” , and store it in variable i. It will continue to do so until there are no IPs left under “webserver” group name.</p><p><strong>groups</strong> is a ansible keyword that always takes values from inventory file. And <strong>loop.index</strong> is to print numbers starting from 0-N.</p><p>Now since this file is written in jinja, we have to save it with <strong>.j2</strong> extension. So here I have renamed the file that we copied before, using below command.</p><blockquote><strong>mv</strong> haproxy.cfg haproxy.cfg.j2</blockquote><p>Finally our config file is ready to we will use template module to copy it to target node and than start the service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*b2jfO7Vtng1FlayLGSP7SA.png" /><figcaption>final play for haproxy.</figcaption></figure><p>NOTE: I have written play to configure webserer in same playbook.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FopTqCNuCi6k%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DopTqCNuCi6k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FopTqCNuCi6k%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f2116990f9dec576076000cc530edc7/href">https://medium.com/media/7f2116990f9dec576076000cc530edc7/href</a></iframe><p>As you can see in above video I have configured an instance having ip →192.168.1.15 , as reverse proxy server.</p><h3>Now I will configure same setup over AWS cloud using instance over there.</h3><p>→ First launch 3 instances. Here I am using Amazon Linux. Also I will configure load balancer on my controller node itself. And the remaining two instances as web server. I am launching only 3 instances because I am using free tier aws account and there is a limit of storage of 30gb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gU3JntxZNg8J2_Znc0RJLA.png" /></figure><p>Note: All my instances are <strong>Amazon Linux instance</strong>. And I have installed ansible by following steps,</p><ol><li><strong>download epel repository</strong></li></ol><blockquote>wget <a href="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm">https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</a></blockquote><p><strong>2. Install epel repo</strong></p><blockquote>yum install epel-release-latest-7.noarch.rpm</blockquote><p><strong>3.</strong> <strong>update epel repo</strong></p><blockquote>yum update -y</blockquote><p><strong>4.</strong> <strong>Install ansible</strong></p><blockquote>pip3 install ansible</blockquote><p>→ Performing same steps as I did previously, but here when configuring ansible on cloud instance, my <strong>ansible.cfg</strong> file looks something like this as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*TBJPU9OxO52smbRdjuQq5g.png" /></figure><p>→ in inventory file instead of password, we have to give ssh public key. For that first you have to copy public key (.pem) file in aws instance using winscp</p><blockquote>Note: when you get error code 3 i.e server permission denied when connecting to instance on aws while creating folder or transferring file then, give permission. So suppose you cannot access root folder than in terminal write,</blockquote><blockquote>#<strong>chmod -R 777 /root</strong></blockquote><blockquote>now you can view root directory, create folder in root directory and transfer file as well</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPACReeTA9d1M4EZvOpvHA.png" /><figcaption>inventory file → ip.txt</figcaption></figure><p>→ playbook looks something like this. It is similar as used previously. I copied it to AWS instance using winscp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55kggRQnKzdZol7W9TbKZg.png" /><figcaption>playbook → loadbalancer.yml</figcaption></figure><p>→ running the playbook successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VRx7VT0B0zb5mZywJwKWQQ.png" /></figure><p>→ Now when I connect to load-balancer instance with it’s public IP and frontend port number — 8080, than as you can see once it will connect to backend web server having IP 172.31.40.180 and when I am refreshing page, it connects to another web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*jLgk7E5dW-WfWKa-XBuFRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*ifF7MgqABMANYMeOcy1LKQ.png" /></figure><p>So that is it for this practical. See you in next one.</p><p><em>thank you for reading</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a55027fbf19f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Hadoop and starting the cluster using Ansible]]></title>
            <link>https://shaharshil2001.medium.com/configuring-hadoop-and-starting-the-cluster-using-ansible-b032cdfa786b?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/b032cdfa786b</guid>
            <category><![CDATA[ansible-playbook]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[httpd]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Sun, 21 Mar 2021 14:09:35 GMT</pubDate>
            <atom:updated>2021-03-21T14:09:35.007Z</atom:updated>
            <content:encoded><![CDATA[<p>Step by step guide on how to configure and start hadoop cluster with help of Ansible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*Iz0xXn6oTM-4zR_dr-IxhQ.png" /></figure><p><strong>NOTE: </strong>In this article I am not using ansible roles. And this practical is performed in RedHat linux 8 OS.</p><blockquote><strong>Github repo :</strong> <a href="https://github.com/iamShahHarshil/hadoop_with_ansible">https://github.com/iamShahHarshil/hadoop_with_ansible</a></blockquote><p>Here in this article I will only explain what tasks are used to configure hadoop on slave and master node.</p><p>Let’s start with master node first.</p><p>First for setting up hadoop in any system, we need hadoop’s and jdk’s rpm files (since this practical is performed in RedHat linux). rpm stands for RedHat package manager. So using copy module, copy both software in master node. IP of master node is already mentioned in inventory file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOyhOobGXVIqnL6kBHeOVA.png" /></figure><p>Now we need to install java and hadoop software as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dE-S65mIkCQFBdujcafIFw.png" /></figure><p>using <em>shell module</em> or we can also use cmd module, the entire rpm command that we usually run manually, will be ran over ssh protocol by ansible. And we store the information regarding jdk installation in a variable called <em>java_install</em>. This variable we use to check if jdk is installed properly or not by checking return code (rc). If <em>rc = 0</em> than success otherwise failure.</p><p>So hadoop software will install only when rc for java installation is 0 i.e. successfull.</p><p>The similar process you have to do for slave node as well. You can write code for slave node in same playbook by mentioning new host or you can create new playbook for slave node. I have made separate playbook for configuring both nodes.</p><p>Obviously we need to give a volume to share. So create an empty folder anywhere you wish. And now we will have to copy and replace hdfs and core file for both, master and slave. These are hadoop configuration files and are used to mention details regarding hadoop cluster like IP and port number for hadoop cluster. So we copy using copy module.</p><blockquote>Note: I have created and stored both files — hdfs-site.xml and core-site.xml with same format and with my details of hadoop cluster, in same folder where my playbook is</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dJNpMTyBXDiy5jHvvb3Kw.png" /></figure><p>But the destination for both files is fixed in master and slave. And name for file is also fixed.</p><p>Finally we will format name node and start namenode services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*qz7pOVHmBvff1txZydAVLQ.png" /></figure><p>Note: Similar steps we have to perform for slave node, but only difference is that we will not format before starting datanode service. And also hadoop conf file ( hdfs-site.xml) is different and for slave node also we will create an empty folder which will be used to link slave node’s storage to the hadoop cluster.</p><p>Remember, Name node i.e. master node is used to manage all slave nodes. Whatever data you upload to hadoop cluster, master will create blocks of same size of these files and distribute them over all slave nodes present in cluster.</p><h4>core-site.xml and hdfs-site.xml files for Datanode.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wiF0CVlZ-onvYQ0vU4L9TQ.png" /><figcaption>core-site.xml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NXsLl4GyAqQLTvZAs-yXA.png" /><figcaption>hdfs-site.xml</figcaption></figure><h4>core-site.xml and hdfs-site.xml files for Namenode.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8RIqJx4287d41XJKyay7bg.png" /><figcaption>core-site.xml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J906Fh_A1s8aJcTiSRXU3A.png" /><figcaption>hdfs-site.xml</figcaption></figure><h4>hadoop-vars.yml file for keeping all variables used in playbook.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*VL1SOr-dIIOLT5sfK-gg_g.png" /></figure><p>Finally run both playbooks one after another using command:</p><blockquote>ansible-playbook masterconf.yml</blockquote><blockquote>ansible-playbook slaveconf.yml</blockquote><h3>How to make HTTPD service idempotence in nature using ansible.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*nG1DbaVTrZl38Bi5PlvzbA.png" /></figure><h4>What idempotence mean here ?</h4><p>If any changes in config file of any service is made, than we have to restart the service in order to reflect the changes we made. So this nature is known as idempotence nature of any service.</p><p>So we can bring this kind of nature to any service using ansible with help of topic called <strong>handlers and notify.</strong></p><p>here I have used handler and notify to make httpd service idempotence in nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*4PttYYjUtl4E9yZGi9TX4A.png" /><figcaption>handlers module.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*UrShJKHG38lXQTocSlPO3A.png" /><figcaption>notify.</figcaption></figure><p>So here notify will call handler only when it will see if some changes are made to conf file. And handlers will restart service as shown above.</p><p><em>So that is it. I have mentioned github link for this repo in the begining of the article.</em></p><p><em>Thank you</em> ✌🏼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b032cdfa786b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Space exploration making the most out of ML/AI]]></title>
            <link>https://shaharshil2001.medium.com/space-exploration-making-the-most-out-of-ml-ai-3a377c22cfe?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a377c22cfe</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[space-exploration]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[nasa]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Fri, 19 Mar 2021 15:24:57 GMT</pubDate>
            <atom:updated>2021-03-28T10:09:39.465Z</atom:updated>
            <content:encoded><![CDATA[<p><em>When it comes to space and ML, than sky is the limit !!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*blCJt2PaMvl9if9GzXRayg.jpeg" /></figure><p>As we all know NASA is one of the organization doing space exploration. They search for different exoplanets, do space expeditions, launch rockets and all such fun stuff. But how do you think all these is possible !!</p><p>I mean NASA collects and processes billions of images, and raw data that come from various space missions and rovers like curiosity, spirit, opportunity and now perseverance. They have to intelligently handle spacecraft repairs, monitor astronaut health, and much more complex things. And all these in reasonable time.</p><p>Well here comes machine learning and artificial intelligence. Machine Learning helps in identifying patterns in images, help make sense of raw data, help in discovering galaxies and planets that were not discovered before and many more fascinating things.</p><p>NASA has various applications for ML in it’s journey of exploring space and finding aliens (if any).</p><p><strong>Self-Driving Rovers on Mars — The Spirit and Opportunity Rovers</strong></p><p>NASA had created the technology for <strong>autonomous driving</strong> for Mars Rovers almost a decade ago, long before google and tesla came in this market.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wy0RYHntIF1tvu628WrvdQ.jpeg" /><figcaption>Curiosity rover | <em>Image Source — NASA</em></figcaption></figure><p>AutoNav — A machine learning based navigation and driving system for self-driving Mars rover was used in the <strong>Spirit</strong> and <strong>Opportunity</strong> rovers which landed on Mars as early as 2004. Another rover launched in 2011, <strong>Curiosity</strong> also uses Autonav and it is a rover that is still exploring Mars till date with the mission of finding water and other factors that might make Mars suitable for human exploration in the future!</p><p>NASA on their latest Mars mission of landing <strong>Perseverance</strong> rover on the Martian surface, says that they used machine learning algorithm and trained the algorithm to count rocks. As part of this pre-landing study, the JPL team and other scientists also used images and simulation software to examine terrain maps, calculate elevations and slopes and then developed a Monte Carlo model of 5,000 possible landing points that took into consideration all possible factors and uncertainties with one single purpose in mind: to keep the rover from falling flat on its digital face when landing on Mars. This took help of ML in processing data and images.</p><p>Another application of Machine Learning in the Mars rovers is an algorithm called <a href="https://www.jpl.nasa.gov/news/news.php?feature=6575"><strong>AEGIS</strong></a> (Autonomous Exploration for Gathering Increased Science).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*es1z2XrgQZ2TSEhXWp295A.jpeg" /><figcaption>Chemcam image | <em>Image Source — NASA</em></figcaption></figure><p>NASA’s Mars rover Curiosity selects rock targets for its laser spectrometer using AEGIS algorithm. AEGIS uses onboard computer analysis of images from Curiosity’s stereo <strong>Navigation Camera (Navcam)</strong>, which are taken routinely at each location where the rover ends a drive. AEGIS selects a target and directs <strong>ChemCam (Chemistry and Camera)</strong> pointing, typically before the Navcam images are transmitted to Earth. This gives the team an extra jump in assessing the rover’s latest surroundings and planning operations for upcoming days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*bXrenaFG-yCEQ9dzV2R5IQ.jpeg" /><figcaption><em>Image Source — NASA</em></figcaption></figure><p>To select a target autonomously, the software’s analysis of images uses adjustable criteria like size of rock and brightness of rock.</p><p>Another AEGIS mode starts with images from ChemCam’s own Remote Micro-Imager, rather than the Navcam, and uses image analysis to hone pointing of the laser at fine-scale targets chosen in advance by scientists. From the top of Curiosity’s mast, the instrument can analyze the composition of a rock or soil target from up to about 23 feet (7 meters) away.</p><blockquote>“<strong>AEGIS</strong> brings an extra opportunity to use ChemCam, to do more, when the interaction with scientists is limited,” said ChemCam Science Operation Lead Olivier Gasnault, at the Research Institute in Astrophysics and Planetology (IRAP), of France’s National Center for Scientific Research (CNRS) and the University of Toulouse, France. “It does not replace an existing mode, but complements it.”</blockquote><p>All these hassle of studying Martian surface is to analyze evidence about how the environment in this part of Mars changed billions of years ago from conditions well suited to microbial life — if life ever existed on Mars — to dry, inhospitable conditions.</p><p>Another great use case of ML that NASA has implemented is <strong>Exploration Medical Capability (ExMC) </strong>i.e. medicine in space.</p><p>When astronauts are on deep space mission, they are far from reach of real medical care. And traveling to the moon, Mars, and other destinations beyond Earth’s orbit will present signifi­cant challenges to the health of human crewmembers. Crews will need medical capabilities to diagnose and treat injuries, as well as address medical conditions triggered by spaceflight hazards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*MBy9IXNa-M__tN_iiXHjCg.png" /><figcaption><em>Exploration Medical Capability — This is how the interior of a future medical habitat in space might look<br>Image Source — NASA</em></figcaption></figure><p>The Exploration Medical Capability (ExMC) Ele­ment develops medical technologies for in-flight diagnosis and treatment, as well as data systems to maintain and protect patients’ private medical data. ExMC physicians and scientists develop models to quantify the probability that a medical event will occur during a mission. Personnel also define pro­cedures for treating an ill or injured crewmember without having access to an emergency room and with limited communications with ground-based personnel for consultation and diagnostic assis­tance.</p><p>Astronauts cannot directly contact doctors on Earth as there is a time-lag and so the ExMC uses machine learning to provide self-reliant autonomous medical care with the help of remote medical technologies.</p><p>Another very interesting service created by NASA is <strong>Planetary Navigation.</strong> Planetary Navigation uses Deep Learning algos to sort of create a map of planetary objects like moon, mars etc.</p><p>On Earth we have GPS to aid us in navigating if we get lost, but what about if you get lost on moon. That would be a disaster, right !!</p><p>The <a href="https://frontierdevelopmentlab.org/"><strong>NASA Frontier Development Lab</strong></a> is working on a project to provide navigation on the surface of celestial bodies including the moon. Interesting huhh !!</p><p>This is done by feeding a Machine Learning System lot’s of images of the moon (2.4 million in this case) and then creating a virtual version of the moon using neural networks. Then if you are lost on the Moon, you can take images of your surroundings and the Machine Learning System will be able to triangulate your location on the moon by comparing your images with the already created image database of the lunar surface that constitutes the virtual moon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*tGJCk8K6x9tQhb3NvnM01w.jpeg" /><figcaption>The Robonaut | <em>Image Source — NASA</em></figcaption></figure><p>Along with these few use cases of AI/ML, NASA has various projects like <strong>The Robonaut</strong>, <strong>Planetary Spectrum Generator</strong> etc. that uses ML at it’s core to solve there problems and improve space exploration.</p><p>NASA continues on helping human kind gather more and more knowledge about all the void (deep space) surrounding us with help of AI/ML along with other state of the art technologies.</p><p><em>Thank you for reading this article. Hope you enjoyed reading it </em>😄✌🏼</p><p>References:</p><p><a href="https://www.geeksforgeeks.org/how-does-nasa-use-machine-learning/">https://www.geeksforgeeks.org/how-does-nasa-use-machine-learning/</a></p><p><a href="https://www.jpl.nasa.gov/news/nasa-mars-rover-can-choose-laser-targets-on-its-own">NASA Mars Rover Can Choose Laser Targets on Its Own</a></p><p>Images — <a href="https://www.nasa.gov/">https://www.nasa.gov/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a377c22cfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Industry use case of openshift]]></title>
            <link>https://shaharshil2001.medium.com/industry-use-case-of-openshift-f41ce11863e1?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/f41ce11863e1</guid>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[bmw]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Sat, 13 Mar 2021 14:38:12 GMT</pubDate>
            <atom:updated>2021-03-13T14:38:12.004Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*cWiBTiHCsWtl12qE" /></figure><p>Openshift is a cloud enabled containerization software developed by RedHat. It is a Platform as a service (PaaS). It’s an open source cloud-based user-friendly platform used to create, test, and run applications, and finally deploy them on cloud. Applications written in languages like Node.js, Ruby, Python, Perl, and Java can be managed by openshift. It helps organizations move there traditional application infrastructure and platform from physical, virtual mediums to the cloud. One of the key features is, it provides managed hardware and network resources for all kinds of development and testing. Openshift is a Kubernetes based orchestration platform.</p><h4>BMW uses RedHat Openshift container platform :</h4><p>Using the Red Hat OpenShift Container Platform, the BMW Group could provide a more secure and stable platform that allowed for container-based deployments. It also allows traditional applications to coexist alongside new, cloud-native and container-based applications.</p><blockquote><strong>“</strong>The BMW Group shows just how an organization can embrace agile methodologies and modern container technologies to deliver business value and an enhanced customer experience.<strong>”</strong> Ashesh Badanivice, president and general manager of OpenShift Red Hat said</blockquote><p>The BMW Group wanted a more flexible application infrastructure to provide more agile development and IT operations methodologies and RedHat Openshift container platform was best suited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f41ce11863e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Industry use cases of Jenkins]]></title>
            <link>https://shaharshil2001.medium.com/industry-use-cases-of-jenkins-c2855c1b91ab?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2855c1b91ab</guid>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 12:27:43 GMT</pubDate>
            <atom:updated>2021-03-12T12:27:43.383Z</atom:updated>
            <content:encoded><![CDATA[<p>Netflix uses technologies like AWS, jenkins and nebula to successfully provide streaming service to end users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*AxcM1c4hGAcOfYYNWhF0Yw.jpeg" /></figure><h4>What is Jenkins ?</h4><p>Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software. As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.</p><p>organizations are looking to evolve their development and deployment processes to be more agile and accelerate time-to-market. They are trying to embrace things like DevOps and Continuous Deployment to do that. They are breaking monolithic apps out into microservices that can be independently updated, with a focus on speed and agility, so their apps can be more reactive to changes in their business. They are evolving from traditional virtualization to public and private cloud deployments.</p><h4>How Netflix builds code using jenkins!!</h4><ul><li>Code is built and tested locally using <strong>Nebula</strong></li><li>Changes are committed to a central <strong>git</strong> repository</li><li>A <strong>Jenkins job</strong> executes Nebula, which builds, tests, and packages the application for deployment</li><li>Builds are “baked” into <strong>Amazon Machine Images</strong></li><li><strong>Spinnaker</strong> pipelines are used to deploy and promote the code change</li></ul><p>Once a line of code has been built and tested locally using Nebula, it is ready for continuous integration and deployment. The first step is to push the updated source code to a git repository. Teams are free to find a git workflow that works for them. Once the change is committed, a <strong>Jenkins job</strong> is triggered.</p><p>Jenkins is used throughout Netflix for a variety of automation tasks above just simple continuous integration. Netflix started with a single massive Jenkins master in their datacenter and have evolved to running 25 Jenkins masters in <strong>AWS. </strong>A Jenkins job is configured to invoke Nebula to build, test and package the application code.</p><p>Notice how different technologies work in harmony to provide us end service like Netflix. So ultimate goal is integration of various technology as one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2855c1b91ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Configure Httpd Web Server on the Top of Docker Container]]></title>
            <link>https://shaharshil2001.medium.com/how-to-configure-httpd-web-server-on-the-top-of-docker-container-1c9bb7c9ae0f?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c9bb7c9ae0f</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 18:51:47 GMT</pubDate>
            <atom:updated>2021-03-11T18:51:47.265Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I will configure httpd web server inside docker OS that is in return running on top of red hat linux 8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IR4iwGp_RHnbxHka.png" /></figure><h4>Before starting make sure</h4><ol><li>Docker software is installed.</li><li>You have basic idea of docker.</li></ol><p><strong>Note:</strong> Here For performing this task I am using REDHAT 8 as the BaseOS.</p><h4>Step-1:</h4><p>Start The Docker Service in Redhat 8 Operating System.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*rUJHB4sjcQOPbE49VxRVXg.png" /></figure><p>Before going further make sure docker is running using following command</p><blockquote>systemctl status docker</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*ZrD7Zsfk9EXWTnXmhyK9Aw.png" /></figure><p>If not running than start using following command</p><blockquote>systemctl start docker</blockquote><h4>Step-2:</h4><p>Pull the Docker Image. I am using centos latest version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*DP8Gy0U3CMMZB5mIuUb7rg.png" /></figure><h4>Step-3:</h4><p>Launch the container on the top of Redhat 8 using centos image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*35TcsuFnLgWwt1KRcItKpQ.png" /></figure><p>As you can notice I am inside my docker container now.</p><h4>Step-4:</h4><p>Install Apache httpd software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/0*1r8xlVkruZonkfa0.png" /></figure><h4>Step-5:</h4><p>Start The HTTPD service</p><p>Normally in Redhat 8, to start this service we always use systemctl start httpd command. But in docker we don’t have that command hence instead we use the command which is mentioned in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*BrSBX72GTxTS4LDYUjFabw.png" /></figure><h4>Step-6:</h4><p>Navigate to /var/www/html.</p><p>In this directory we have to put the webpages created by us. Here I have created one webpage called index.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*-4VafsLdFPLcbbeX3-Rjmw.png" /></figure><p>The HTML code of this file looks like this. In this way you can also but various webpages in this folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*6EiQXJgYgao-JGlR9ecXmA.png" /></figure><h4>Step-8:</h4><p>Access the webpage in Browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*f6J2aItBW2Bcg8IBO99udw.png" /></figure><h4>Now setting up python interpreter and running inside docker container.</h4><p>We can install python3 on docker container using yum command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*TV5VSmZsfTzgefUJM9Wdgw.png" /></figure><p>Python 3 is installed in Docker Container, Now you can create a python file and simply run it .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*eDG5ZZpq-mQJX9i2zbxHKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*cWxSuyhiJ4VGlvEylPKBWA.png" /></figure><p>Final output as seen above.</p><p><em>Thank you for reading all !!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c9bb7c9ae0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating LVM with Hadoop Cluster]]></title>
            <link>https://shaharshil2001.medium.com/integrating-lvm-with-hadoop-cluster-d29f0509862c?source=rss-761021776977------2</link>
            <guid isPermaLink="false">https://medium.com/p/d29f0509862c</guid>
            <category><![CDATA[arth]]></category>
            <category><![CDATA[lvm]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[hadoop-cluster]]></category>
            <category><![CDATA[vimal-daga]]></category>
            <dc:creator><![CDATA[Harshil Shah]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 18:06:52 GMT</pubDate>
            <atom:updated>2021-03-11T18:06:52.415Z</atom:updated>
            <content:encoded><![CDATA[<p>Here I will use LVM to provide elasticity to hadoop cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*AurWrww0XG6U611o" /></figure><h3>What is LVM ?</h3><p>Logical Volume Management (LVM) creates a layer of abstraction over physical storage, allowing you to create logical storage volumes. With LVM in place, you are not bothered with physical disk sizes because the hardware storage is hidden from the software so it can be resized and moved without stopping applications or unmounting file systems. You can think of LVM as dynamic partitions.</p><h3>What is Hadoop?</h3><p>Hadoop is an open source, a Java-based programming framework that supports the storage and processing of extremely large data sets in a distributed computing environment. It is part of the Apache project sponsored by the Apache Software Foundation.</p><p>First as you can see I have one datanode attached to master. And it is sharing a total of 46.9 GB of storage. Here I have used RedHat Linux VM.</p><blockquote>hadoop dfsadmin -report</blockquote><p>use above command to see how many slave nodes are connected to master and what volume they are sharing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*cbIuZAEw7uzD56cnCZkfWA.png" /></figure><h3>STEP: 1</h3><p>Create hard disk from settings of you namenode VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*Pwtb96_rlvX-p2dT1dJ8Yg.png" /></figure><p>Attached hard disk info can be seen with fdisk -l command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*AUEABgqeBJCTs7DnWK3JAw.png" /></figure><h3>Step 2:</h3><p>Convert the hard disk to Physical Volume(PV)</p><p>pvcreate command initialize these disks so that they can be a part in forming volume groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*xRKlCj8G45Ed_SCeLLRulA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*waG57Nv7lB6hmQJ_JYrsEA.png" /></figure><h3>Step 3:</h3><p>Create a volume group</p><p>Physical volumes are combined into volume groups (VGs). It creates a pool of disk space out of which logical volumes can be allocated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*-VNUceaVkQzq27RIM5P_yw.png" /></figure><h3>Step 4:</h3><p>Create a Logical Volume</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*0Cwkb30BSLURgMy8B0VHDg.png" /></figure><p>As you can see I have created Logical volume of 5 GB for now.</p><h3>Step 5:</h3><p>Format the Logical Volume/partition. We have to provide entire path of logical volume ( In above figure i.e LV Path value)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*TkytJt6wky9L3HoND3h9Lg.png" /></figure><h3>Step 6:</h3><p>mount the partition to the folder you used to share in hadoop cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*REptOPH3EL_Y4OcSDrPSFw.png" /></figure><p>Now when you again check report using hadoop dfsadmin -report command, my new LVM is attached instead of original 46.9G volume. As shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*QtpQzddxO7KAJdBUJDTwlw.png" /></figure><h3>Step 7:</h3><p>To increase the size of the LV/partition use lvextend command. I am extending more 15 GB volume in my LVM only and it will increase storage capacity in my hadoop cluster automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*UWZpayB7xIdUhE2bdAAsjQ.png" /></figure><h3>Step 8:</h3><p>Now, reformat the new storage added to the LV using resize2fs command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*IcjsL9wb6T8HtQR2vhVOrA.png" /></figure><h3>Step 9:</h3><p>Check the size of storage using <strong><em>df -h</em></strong> command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*kgqe_xhbTLDCT_yHcExnDg.png" /></figure><p>As you can see my lvm volume size has increased to 19G since I extended more 15G.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*_-MP1sxjGuu5dtbGyBqI4g.png" /></figure><p>As you can notice my hadoop cluster storage capacity has also increased upto 19.62G. Before it was 4G</p><p>We finally dynamically increased hadoop cluster volume using LVM.</p><p><em>Thank you for reading it through !!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d29f0509862c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>