<?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 Amit Mishra on Medium]]></title>
        <description><![CDATA[Stories by Amit Mishra on Medium]]></description>
        <link>https://medium.com/@amitmishra_393?source=rss-b0f83c7b4442------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7RhNc_g4OLEJ9hEQI4HDUw.jpeg</url>
            <title>Stories by Amit Mishra on Medium</title>
            <link>https://medium.com/@amitmishra_393?source=rss-b0f83c7b4442------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:43:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amitmishra_393/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[Hadoop 3.x Installation on Ubuntu 18.04]]></title>
            <link>https://medium.com/@amitmishra_393/hadoop-3-0-installation-on-ubuntu-18-04-step-by-step-pseudo-distributed-mode-2808f6b8e71f?source=rss-b0f83c7b4442------2</link>
            <guid isPermaLink="false">https://medium.com/p/2808f6b8e71f</guid>
            <category><![CDATA[hadoop-3-installation]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[pseudo-distributed-mode]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Amit Mishra]]></dc:creator>
            <pubDate>Sat, 11 Aug 2018 16:46:24 GMT</pubDate>
            <atom:updated>2019-02-20T10:45:19.612Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hadoop 3.x Installation on Ubuntu 18.04 Step By Step | Pseudo Distributed Mode on Single Node Cluster</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*bOoKtJXL5qkYipeM4orIrA.png" /></figure><blockquote>Are you still struggling to create your own custom hadoop pseudo mode cluster with no dependency on cloudera or hortonworks ..?<br>Here is A generic draft for step by step installation of latest hadoop 3.0 on linux ubuntu environment. Follow step by step &amp; enjoy working on newly updated hadoop framework for big data analytics and storage.</blockquote><h3><strong>Before You Begin …</strong></h3><p>Before we start with installation of hadoop framework we must prepare a ubuntu environment. For this story, I am using latest version 18.04 version.</p><h4><strong>Create A New User</strong></h4><p>We begin with adding a new user , open a new terminal <em>(Ctrl+Alt+T)</em> &amp; type the following commands. Firstly, create a group <em>hadoop </em>and add a new user <em>hduser</em> within the same <em>hadoop</em> group. <br> <strong><em><br></em></strong><em>sudo addgroup hadoop<br>sudo adduser -- ingroup hadoop hduser</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*ITz0yjUq5okwQ2koqFW_eA.png" /><figcaption>To add a new user ‘<strong>hduser’</strong> only provide the new password rest all skip just by pressing enter</figcaption></figure><p>The newly created user will require necessary root permissions for custom files installation. To do so we have to open the <em>sudoers</em> file (<em>sudo visudo)</em> and provide created user <em>hduser </em>root user privileges<em> </em>by updating the file like below</p><p><em>sudo visudo<br>hduser ALL=(ALL:ALL) ALL</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*cUDHOtuGmFi4mdmp181S5w.png" /><figcaption>Add the highlighted line in the <strong>sudoers</strong> file to give root permissions to hduser</figcaption></figure><blockquote><strong>Note:</strong> To exit from ‘nano’ editor window (Ctrl+X) to save changes press Y press enter to exit back to working terminal.</blockquote><p>So, Now our new user is ready lets switch to <em>hduser </em>for installing hadoop framework environment.</p><p><em>su - hduser</em></p><h4><strong>Java Environment ..</strong></h4><p><strong>Surprise! </strong>Before we install hadoop we have understand a quick simple concept: Hadoop framework requires java environment for running all its services on separate Java Virtual Machine (true only for pseudo distributed mode). Download JDK 8 or above, with java 7 attaining end of life in 2015, Hadoop 3.x revised the min. run time version to Java 8 or above.</p><p>Make sure the user changed from root user to <em>hduser (su - hduser). </em>Specify<em> a </em>preferred<em> </em>directory for storing all files for hadoop I always prefer <em>/usr/local</em>.</p><p><em>cd /usr/local</em></p><p><em>sudo wget --no-cookies --no-check-certificate --header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz&quot;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*YpaM3CRFdQsRc8PD98U0aQ.png" /><figcaption>switch user to <strong>hduser </strong>and download jdk in /usr/local</figcaption></figure><p>Extract the downloaded<em> </em>jdk file<em> jdk-8u181-linux-x64.tar.gz </em>in same preferred location<em> /usr/local</em>. Rename the extracted file from <em>jdk1.8.0_181 </em>to <strong><em>java.</em></strong></p><p><em>sudo tar xvzf jdk-8u181-linux-x64.tar.gz<br>sudo mv jdk1.8.0_181 java</em></p><p>Now we have an extracted java file in /usr/local. But ubuntu 18.04 is unaware of the java environment. Lets set the java environment in <em>.bashrc f</em>ile<em> </em>or <em>.profile </em>file <em>(for future stories I will prefer bashrc).</em></p><p>Doing so is compulsory, first change the working directory from <em>/usr/local</em> to <em>home directory, </em>open the .bashrc file and add following.</p><p><em>(check if java file is present or not!)</em><br><em>ls<br>cd ~<br>sudo nano ~/.bashrc</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*vlD64oVdHsygTniaisNB7A.png" /></figure><p>Set up java environment in <em>.bashrc</em> file by setting up <em>java_home </em>location and java bin <em>path directory.</em></p><p><em>export JAVA_HOME=/usr/local/java<br>export PATH=$PATH:/usr/local/java/bin</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*_jVsj_8lFPKrvjFcxAdurQ.png" /></figure><blockquote><strong>Note : </strong>Whenever you update .bashrc file it apply changes in ubuntu environment either by rebooting the system or the better option applying <strong><em>source ~/.bashrc</em></strong></blockquote><h4><strong>Setting Oracle JDK as the default JVM…</strong></h4><p>In our case, the java executable is located under /usr/local/java . To set the JVM environment location in your machine run <em>following commands</em><strong><em>.</em></strong><em> </em>Let us update the environment with the setting the <strong><em>java (java executable), javac (java compiler), javaws (java web start).</em></strong></p><p><em>sudo update-alternatives --install “/usr/bin/java” “java” “/usr/local/java/bin/java” 1<br>sudo update-alternatives --install “/usr/bin/javac” “javac” “/usr/local/java/bin/javac” 1<br>sudo update-alternatives --install “/usr/bin/javaws” “javaws” “/usr/local/java/bin/javaws” 1</em></p><p><strong>Verify that java has been successfully configured by executing:</strong></p><p><em>sudo update-alternatives --set java /usr/local/java/bin/java<br>sudo update-alternatives --set javac /usr/local/java/bin/javac<br>sudo update-alternatives --set javaws /usr/local/java/bin/javaws</em></p><p><strong>Verify java environment manual installation is completed in the ubuntu system.</strong></p><p><em>java -version</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*plT9GpzjZLs1X_vvQ5lPfQ.png" /></figure><blockquote>If you have completed till here, <strong>Congratulations</strong> !! You have just learned how to do manual installation oracle jdk8 on linux environment…</blockquote><h4><strong>Setting Up Hduser with SSH Keys &amp; Enable Localhost</strong></h4><p>Hadoop services like Resource Manager &amp; Node Manager uses <em>ssh</em> to share the status of nodes like job scheduling, running status of job, status of DataNodes (alive or not) with all services that running on localhost on separate jvm they exchanges messages b/w slave to master &amp; master to master via. ssh.</p><p><strong>SSH</strong>(Secure Protocol) is used as the primary means of connecting to Linux servers remotely. In this case <em>ssh localhost</em> is about doing secure ssh to host i.e. localhost.</p><p>Try starting your localhost using command: <em>ssh localhost. Doing so initially may throw connection refused error message…</em><strong><em><br>ssh: connect to host localhost port 22: Connection refused</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*4tndJoazOejAc0PqwtN4fQ.png" /></figure><blockquote><strong>Note:</strong> If it doesn’t throw any error &amp; succeeds in doing ssh to localhost you can skip these steps &amp; jump to Hadoop Installation.</blockquote><p>To handle connection refused error Follow the commands step by step …<strong>Remove older version SSH:</strong><br><em>sudo apt-get remove openssh-server openssh-client</em></p><p><strong>Install SSH Again:<em><br></em></strong><em>sudo apt-get update<br>sudo apt-get install openssh-server openssh-client<br>sudo ufw allow 22</em></p><p><em>sudo systemctl restart ssh<br>sudo apt-get install ssh<br>sudo apt-get install rsync</em></p><p>After installing ssh (secure protocol)lets make ssh a secure communication by generating ssh keys and copying the key value in <em>~/.ssh/authorized_keys.</em></p><p><strong>Generate Keys for secure communication:</strong><br><em>ssh-keygen -t dsa -P ‘’ -f ~/.ssh/id_dsa<br>cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys<br>ssh-keygen -t rsa</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*XqR5By1lUdbnT0s6sZSlHQ.png" /></figure><p>Try <em>ssh localhost</em> again if it asks for password-login as shown below follow the next… Otherwise jump to hadoop installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*MFdzcA8KyY50WuwTsU6R5w.png" /></figure><p>Generate the ssh key again, store key in <em>~/.ssh/id_rsa.pub. </em>Now,copy the keys to <em>~/.ssh/authorized_keys </em>using cat command &amp; change permissions of <em>authorized_keys.</em></p><p><em>ssh-keygen -t rsa<br>cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys<br>chmod og-wx ~/.ssh/authorized_keys <br>sudo apt-get update<br>ssh localhost</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*a-5MpehpjlFqBA4hzaB0Iw.png" /></figure><blockquote><strong>SSH </strong>to localhost is now secured &amp; remotely accessible without password login requirement. Now our prerequisites to hadoop installation been completed successfully.<br><strong>Note: </strong>Don’t forget to exit from localhost before proceeding to next.</blockquote><h3><strong>Hadoop 3.x Installation Step By Step</strong></h3><p>Now, lets proceed towards major step of hadoop installation with downloading the latest stable release of hadoop 3.0.2. First get back to location /usr/local &amp; download the stable release[When I publishing this hadoop3.0.2 is the stable version].</p><p><em>cd /usr/local<br>sudo wget </em><a href="http://redrockdigimark.com/apachemirror/hadoop/common/hadoop-3.0.2/hadoop-3.0.2.tar.gz"><em>http://redrockdigimark.com/apachemirror/hadoop/common/hadoop-3.0.2/hadoop-3.0.2.tar.gz</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*EfvX-kZaXlvpUhuWwMrzOQ.png" /></figure><p>Extract the the hadoop file in same location and rename the extracted folder <em>hadoop-3.0.2</em> to <em>hadoop </em>(just like we did for java).</p><p><em>sudo tar xvzf hadoop-3.0.2.tar.gz<br>sudo mv hadoop-3.0.2 hadoop</em></p><p>Now we has a folder hadoop framework installed in ubuntu in an embryonic stage.</p><h3><strong>Setting Up Hadoop 3.x in Pseudo Distributed Mode</strong></h3><p>Hadoop Framework supports three working modes : Standalone Mode, Pesudo-Distributed Mode, Fully-Distributed Mode. Where, standalone runs all its services in single machine &amp; single JVM, pseudo-distributed mode runs all in one system but on separate JVMs (Best suitable for learning hadoop). Where enterprises set up hadoop in Fully-Distributed Mode each master &amp; slave services running in separate systems &amp; different JVMs. In this story I will be covering pseudo distributed mode.</p><p>First, provide the ownership of hadoop to ‘user’ hduser [“ This will give ownership only to hduser for running hadoop services ”] using chmod &amp; change the mode of <em>hadoop</em> folder to read, write &amp; execute modes of working.</p><p><em>sudo chown -R hduser:hadoop /usr/local/hadoop<br>sudo chmod -R 777 /usr/local/hadoop</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*-duB6j7zzDjKek5t1j2wNg.png" /></figure><h4><strong>Disable IPV6</strong></h4><p>Hadoop &amp; IPV6 does not agrees on the meaning of address 0.0.0.0 so we need to disable IPV6 editing the file…<br><em>sudo nano /etc/sysctl.conf<br></em><strong><em>with…<br></em></strong><em>net.ipv6.conf.all.disable_ipv6=1<br>net.ipv6.conf.default_ipv6=1<br>net.ipv6.conf.lo.disable_ipv6=1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*shoqZzgJ_s1nKmnIPQytMg.png" /></figure><p>For confirming if IPV6 is disable or not! execute the command.<br><em>cat /proc/sys/net/ipv6/conf/all/disable_ipv6</em></p><h4><strong>Setting Hadoop Environment</strong></h4><p>Apply changes in <em>.bashrc </em>file for setting the necessary hadoop environment. Setting changes with hadoop path. Locations of <strong>sbin</strong>[ “It stores hadoop’s necessary command location” ] &amp; <strong>bin </strong>directory path are essential otherwise as user you have to always change location to hadoop’s sbin or bin to run required commands.</p><p><em>sudo nano ~/.bashrc</em></p><p><strong><em>#HADOOP ENVIRONMENT</em><br></strong><em>export HADOOP_PREFIX=/usr/local/hadoop<br>export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop<br>export HADOOP_MAPRED_HOME=/usr/local/hadoop<br>export HADOOP_COMMON_HOME=/usr/local/hadoop<br>export HADOOP_HDFS_HOME=/usr/local/hadoop<br>export YARN_HOME=/usr/local/hadoop<br>export PATH=$PATH:/usr/local/hadoop/bin<br>export PATH=$PATH:/usr/local/hadoop/sbin</em></p><p><strong><em>#HADOOP NATIVE PATH:</em></strong><br><em>export “HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native<br>export HADOOP_OPTS=“-Djava.library.path=$HADOOP_PREFIX/lib”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*lZAjkh6IIBJJAQ6orkIEuw.png" /></figure><p>After completing native directory path setting &amp; configuring. Proceed the next step to hadoop configuration file setting …</p><h4><strong>Setting up Hadoop Configurations …</strong></h4><p>Lets change the working directory to hadoop configurations location<br><em>cd /usr/local/hadoop/etc/hadoop/</em></p><p><strong>1. hadoop-env.sh<br></strong>Open hadoop-env file &amp; change the configurations…</p><p><em>sudo nano hadoop-env.sh</em></p><p>In Hadoop, by default logging level will be determined by logging<br>configuration variable <em>HADOOP_ROOT_LOGGER</em> in <em>hadoop-env.sh</em> file.<br>Set new configurations in hadoop environment file…</p><p><em>export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true<br>export JAVA_HOME=/usr/local/java<br>export HADOOP_HOME_WARN_SUPPRESS=”TRUE”<br>export HADOOP_ROOT_LOGGER=”WARN,DRFA”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*jtojYXxD2lfNeRFvrxNhdA.png" /></figure><p><strong>2. yarn-site.xml<br></strong>Open hadoop-env file &amp; set the configurations …</p><p><em>sudo nano yarn-site.xml</em></p><p><em>&lt;property&gt;<br>&lt;name&gt;yarn.nodemanager.aux-services&lt;/name&gt;<br>&lt;value&gt;mapreduce_shuffle&lt;/value&gt;<br>&lt;/property&gt;<br>&lt;property&gt;<br>&lt;name&gt;yarn.nodemanager.aux-services.mapreduce.shuffle.class&lt;/name&gt;<br>&lt;value&gt;org.apache.hadoop.mapred.ShuffleHandler&lt;/value&gt;<br>&lt;/property&gt;</em></p><blockquote><strong>Note :</strong> Do exactly same to set all other configuration files..</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*hBNAZ_D4WtKT8h1jWCSKzA.png" /></figure><p><strong>3. hdfs-site.xml</strong></p><p><em>sudo nano hdfs-site.xml</em></p><p><em>&lt;property&gt;<br>&lt;name&gt;dfs.replication&lt;/name&gt;<br>&lt;value&gt;1&lt;/value&gt;<br>&lt;/property&gt;<br>&lt;property&gt;<br>&lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;<br>&lt;value&gt;file:/usr/local/hadoop/yarn_data/hdfs/namenode&lt;/value&gt;<br>&lt;/property&gt;<br>&lt;property&gt;<br>&lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;<br>&lt;value&gt;file:/usr/local/hadoop/yarn_data/hdfs/datanode&lt;/value&gt;<br>&lt;/property&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*kwe5IoFI_X-ZK33lwgXo3w.png" /></figure><p><strong>4. core-site.xml</strong></p><p><em>sudo nano core-site.xml</em></p><p><em>&lt;property&gt;<br>&lt;name&gt;hadoop.tmp.dir&lt;/name&gt;<br>&lt;value&gt;/app/hadoop/tmp&lt;/value&gt;<br>&lt;/property&gt;<br>&lt;property&gt;<br>&lt;name&gt;fs.default.name&lt;/name&gt;<br>&lt;value&gt;hdfs://localhost:9000&lt;/value&gt;<br>&lt;/property&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*YJUz6iUXh1Gaf7-OZdP17A.png" /></figure><p><strong>5. mapred-site.xml</strong></p><p><em>sudo nano mapred-site.xml</em></p><p><em>&lt;property&gt;<br>&lt;name&gt;mapred.framework.name&lt;/name&gt;<br>&lt;value&gt;yarn&lt;/value&gt;<br>&lt;/property&gt;<br>&lt;property&gt;<br>&lt;name&gt;mapreduce.jobhistory.address&lt;/name&gt;<br>&lt;value&gt;localhost:10020&lt;/value&gt;<br>&lt;/property&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*lrWuwJ7VeBarQefWy9yDoA.png" /></figure><p><strong>Create a temp directory which will be used as base location for <em>DFS…</em></strong></p><p>Now we have updated all hadoop configuration files, first get back to home directory &amp; create temp directory.</p><p><em>sudo mkdir -p /app/hadoop/tmp<br>sudo chown -R hduser:hadoop /app/hadoop/tmp<br>sudo chmod -R 777 /app/hadoop/tmp</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*k6sJApLbf0Qyy1_GyINlKw.png" /></figure><p>Create Directory where hadoop will store its yarn data work and give good permission to it “path set for namenode &amp; datanode in hdfs-site.xml”</p><p><em>sudo mkdir -p /usr/local/hadoop/yarn_data/hdfs/namenode<br>sudo mkdir -p /usr/local/hadoop/yarn_data/hdfs/datanode<br>sudo chmod -R 777 /usr/local/hadoop/yarn_data/hdfs/namenode<br>sudo chmod -R 777 /usr/local/hadoop/yarn_data/hdfs/datanode<br>sudo chown -R hduser:hadoop /usr/local/hadoop/yarn_data/hdfs/namenode<br>sudo chown -R hduser:hadoop /usr/local/hadoop/yarn_data/hdfs/datanode</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*aU_bf3Ky7BxGou_row4WOQ.png" /></figure><p>Format, hadoop namenode to clean the cluster before we start all hadoop framework’s core services.</p><p><strong><em>hdfs namenode -format</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*GRp9L0XvMbRQ4ikduf8PEg.png" /><figcaption><strong>Output to format the namenode with Cluster ID</strong></figcaption></figure><p>Start all hadoop services by executing command one by one.<br><strong><em>start-dfs.sh <br>start-yarn.sh</em></strong></p><p><em>With all Hadoop services running in pesudo-distributed mode <br>Congratulations! the coolest </em><strong><em>AVENGER</em></strong><em> from </em><strong><em>B</em></strong><em>ig </em><strong><em>D</em></strong><em>ata </em><strong><em>U</em></strong><em>niverse does superhero entry in your system … </em><strong><em>HAPPY LEARNING :)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yy3YhVLvB-xncovXgIIQwQ.png" /><figcaption><strong>All five core services running in system with jps(java program services)</strong></figcaption></figure><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2IVAl0TbsfES9cFGYr40g.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_read_later_text">Journal</a>.</p><p>🗞 Wake up every Sunday morning to the week’s most noteworthy Tech stories, opinions, and news waiting in your inbox: <a href="https://usejournal.com/newsletter/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_text">Get the noteworthy newsletter &gt;</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2808f6b8e71f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>