<?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 Sanjay S on Medium]]></title>
        <description><![CDATA[Stories by Sanjay S on Medium]]></description>
        <link>https://medium.com/@sanjayshankar1428?source=rss-16cf77ff452------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*niUFK8i1QhR3Wa3q</url>
            <title>Stories by Sanjay S on Medium</title>
            <link>https://medium.com/@sanjayshankar1428?source=rss-16cf77ff452------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:59:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjayshankar1428/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[Installation of Hadoop on Ubuntu 2023]]></title>
            <link>https://sanjayshankar1428.medium.com/in-the-world-of-big-data-managing-and-processing-vast-amounts-of-information-efficiently-is-2ffdc0204357?source=rss-16cf77ff452------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ffdc0204357</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[big-data-analytics]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sanjay S]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 16:47:53 GMT</pubDate>
            <atom:updated>2023-11-22T10:38:50.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N7sLnkaU7w3IWoOX" /><figcaption>Photo by Clay Banks on Unsplash</figcaption></figure><p>In the world of big data, managing and processing vast amounts of information efficiently is paramount. Hadoop, an open-source framework, has emerged as a powerful tool for distributed storage and processing of data. If you’re eager to harness the potential of Hadoop for your data projects but find the installation process daunting, fear not! This blog will walk you through the steps to install Hadoop on your Ubuntu system, demystifying the process and setting you on the path to exploring the limitless possibilities of big data analytics. Whether you’re a seasoned data professional or just beginning your data journey, this guide will help you get started with Hadoop on Ubuntu, making big data more accessible than ever before. So, let’s dive in and unlock the world of distributed data processing.</p><h4>Step 1 : Install Java Development Kit</h4><p>The default Ubuntu repositories contain Java 8 and Java 11 both. I am using Java 8 because hive only works on this version.Use the following command to install it.</p><pre>sudo apt update &amp;&amp; sudo apt install openjdk-8-jdk<br></pre><h3>Step 2 : Verify the Java version :</h3><p>Once you have successfully installed it, check the current Java version:</p><pre>java -version<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WTEemkk-aa96H6i9l4M0Bg.png" /></figure><h3>Step 3 : Install SSH :</h3><p>SSH (Secure Shell) installation is vital for Hadoop as it enables secure communication between nodes in the Hadoop cluster. This ensures data integrity, confidentiality, and allows for efficient distributed processing of data across the cluster.</p><pre>sudo apt install ssh</pre><h3>Step 4 : Create the hadoop user :</h3><p>All the Hadoop components will run as the user that you create for Apache Hadoop, and the user will also be used for logging in to Hadoop’s web interface.</p><p>Run the command to create user and set password :</p><pre>sudo adduser hadoop<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eG1RAib4gZBNUpzHZm_kAQ.png" /></figure><h3>Step 5 : Switch user :</h3><p>Switch to the newly created hadoop user:</p><pre>su - hadoop <br></pre><h3>Step 6 : Configure SSH :</h3><p>Now configure password-less SSH access for the newly created hadoop user, so I didn’t enter key to save file and passpharse. Generate an SSH keypair first:</p><pre>ssh-keygen -t rsa</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPtASkzyzpeiZJOY7BZ1uw.png" /></figure><h3>Step 7 : Set permissions :</h3><p>Copy the generated public key to the authorized key file and set the proper permissions:</p><pre>cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys   <br>chmod 640 ~/.ssh/authorized_keys<br><br></pre><h3>Step 8 : SSH to the localhost</h3><pre>ssh localhost</pre><p>You will be asked to authenticate hosts by adding RSA keys to known hosts. Type yes and hit Enter to authenticate the localhost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JAV0PVWdM4eAgiHk2L749A.png" /></figure><h3>Step 9 : Switch user</h3><p>Again switch to hadoop</p><pre>su - hadoop<br></pre><h3>Step 10 : Install hadoop</h3><ul><li>Download hadoop 3.3.6</li></ul><pre>wget https://dlcdn.apache.org/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz<br></pre><ul><li>Once you’ve downloaded the file, you can unzip it to a folder.</li></ul><pre>tar -xvzf hadoop-3.3.6.tar.gz<br></pre><ul><li>Rename the extracted folder to remove version information. This is an optional step, but if you don’t want to rename, then adjust the remaining configuration paths.</li></ul><pre>mv hadoop-3.3.6 hadoop<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fuw9QIRUypg-ij63GhB2Kg.png" /></figure><ul><li>Next, you will need to configure Hadoop and Java Environment Variables on your system. Open the ~/.bashrc file in your favorite text editor.Here I am using nano editior , to pasting the code we use ctrl+shift+v for saving the file ctrl+x and ctrl+y ,then hit enter:</li></ul><pre>nano ~/.bashrc</pre><ul><li>Append the below lines to the file.</li></ul><pre>export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64<br>export HADOOP_HOME=/home/hadoop/hadoop<br>export HADOOP_INSTALL=$HADOOP_HOME<br>export HADOOP_MAPRED_HOME=$HADOOP_HOME<br>export HADOOP_COMMON_HOME=$HADOOP_HOME<br>export HADOOP_HDFS_HOME=$HADOOP_HOME<br>export HADOOP_YARN_HOME=$HADOOP_HOME<br>export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native<br>export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin<br>export HADOOP_OPTS=&quot;-Djava.library.path=$HADOOP_HOME/lib/native&quot;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pax8V4GUw1ZOvVRKUEbVMw.png" /></figure><ul><li>Load the above configuration in the current environment.</li></ul><pre>source ~/.bashrc<br></pre><ul><li>You also need to configure JAVA_HOME in hadoop-env.sh file. Edit the Hadoop environment variable file in the text editor:</li></ul><pre>nano $HADOOP_HOME/etc/hadoop/hadoop-env.sh</pre><p>Search for the “export JAVA_HOME” and configure it .</p><pre>JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBaz-g3LTvgTFVYD6pzd3Q.png" /></figure><h3>Step 11 : Configuring Hadoop :</h3><ul><li>First, you will need to create the namenode and datanode directories inside the Hadoop user home directory. Run the following command to create both directories:</li></ul><pre>cd hadoop/</pre><pre>mkdir -p ~/hadoopdata/hdfs/{namenode,datanode}<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NClZc4RfBMaHJGSzntlODw.png" /></figure><ul><li>Next, edit the core-site.xml file and update with your system hostname:</li></ul><pre>nano $HADOOP_HOME/etc/hadoop/core-site.xml <br></pre><p>Change the following name as per your system hostname:</p><pre>&lt;configuration&gt;<br>    &lt;property&gt;<br>        &lt;name&gt;fs.defaultFS&lt;/name&gt;<br>        &lt;value&gt;hdfs://localhost:9000&lt;/value&gt;<br>    &lt;/property&gt;<br>&lt;/configuration&gt;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGC6XKSYxvaW2XsMMeREkQ.png" /></figure><p>Save and close the file.</p><ul><li>Then, edit the hdfs-site.xml file:</li></ul><pre>nano $HADOOP_HOME/etc/hadoop/hdfs-site.xml <br></pre><ul><li>Change the NameNode and DataNode directory paths as shown below:</li></ul><pre>&lt;configuration&gt;<br>    &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><br>    &lt;property&gt;<br>        &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;<br>        &lt;value&gt;file:///home/hadoop/hadoopdata/hdfs/namenode&lt;/value&gt;<br>    &lt;/property&gt;<br><br>    &lt;property&gt;<br>        &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;<br>        &lt;value&gt;file:///home/hadoop/hadoopdata/hdfs/datanode&lt;/value&gt;<br>    &lt;/property&gt;<br>&lt;/configuration&gt;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPR-i0zIQHL7zrYng7R8ig.png" /></figure><ul><li>Then, edit the mapred-site.xml file:</li></ul><pre>nano $HADOOP_HOME/etc/hadoop/mapred-site.xml<br></pre><ul><li>Make the following changes:</li></ul><pre>&lt;configuration&gt;<br>    &lt;property&gt;<br>        &lt;name&gt;mapreduce.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.admin.user.env&lt;/name&gt;<br>        &lt;value&gt;HADOOP_MAPRED_HOME=$HADOOP_COMMON_HOME&lt;/value&gt;<br>    &lt;/property&gt;<br>    &lt;property&gt;<br>        &lt;name&gt;yarn.app.mapreduce.am.env&lt;/name&gt;<br>        &lt;value&gt;HADOOP_MAPRED_HOME=$HADOOP_COMMON_HOME&lt;/value&gt;<br>    &lt;/property&gt;<br>&lt;/configuration&gt;<br><br></pre><ul><li>Then, edit the yarn-site.xml file:</li></ul><pre>nano $HADOOP_HOME/etc/hadoop/yarn-site.xml<br></pre><ul><li>Make the following changes:</li></ul><pre>&lt;configuration&gt;<br>    &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;/configuration&gt;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OawA5l-9xUuyquYAP9bxqA.png" /></figure><p>Save the file and close it .</p><h3>Step 12 : Start Hadoop cluster:</h3><ul><li>Before starting the Hadoop cluster. You will need to format the Namenode as a hadoop user.</li><li>Run the following command to format the Hadoop Namenode:</li></ul><pre>hdfs namenode -format<br></pre><ul><li>Once the namenode directory is successfully formatted with hdfs file system, you will see the message “Storage directory /home/hadoop/hadoopdata/hdfs/namenode has been successfully formatted“.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AMqXCFCpunvXyGTa36RcmQ.png" /></figure><ul><li>Then start the Hadoop cluster with the following command.</li></ul><pre>start-all.sh<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*d17aGtK8bceCGsKYjK8ngQ.png" /></figure><ul><li>You can now check the status of all Hadoop services using the jps command:</li></ul><pre>jps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QNEisaXky6C-C24V8AE5Q.png" /></figure><h3>Step 13 : Access Hadoop Namenode and Resource Manager :</h3><ul><li>First we need to know our ip address,In Ubuntu we need to install net-tools to run ipconfig command, If you installing net-tools for the first time switch to default user :</li></ul><pre>sudo apt install net-tools </pre><ul><li>Then run ifconfig command to know our ip address:</li></ul><pre>ifconfig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Lcgeb1QQOBi47ZiJOi5eQ.png" /></figure><p>Here my ip address is 192.168.1.6.</p><ul><li>To access the Namenode, open your web browser and visit the URL <a href="http://your-server-ip:9870.">http://your-server-ip:9870.</a> You should see the following screen:</li></ul><p><a href="http://hadoop.tecadmin.net:9870/"><strong>http://192.168.1.6:9870</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BriNesane-Zp1EcN1-goQ.png" /></figure><ul><li>To access Resource Manage, open your web browser and visit the URL <a href="http://your-server-ip:8088.">http://your-server-ip:8088.</a> You should see the following screen:</li></ul><p><a href="http://hadoop.tecadmin.net:8088/">http://192.168.1.6:8088</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdLPFMVCUQFXschJSuTM_g.png" /></figure><h3><strong>Step 13 :</strong>Verify the Hadoop Cluster :</h3><p>At this point, the Hadoop cluster is installed and configured. Next, we will create some directories in the HDFS filesystem to test the Hadoop.</p><ul><li>Let’s create some directories in the HDFS filesystem using the following command:</li></ul><pre>hdfs dfs -mkdir /test1<br>hdfs dfs -mkdir /logs </pre><ul><li>Next, run the following command to list the above directory:</li></ul><pre>hdfs dfs -ls /</pre><p>You should get the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rnqqi1sJsag4lox9N-DgOw.png" /></figure><ul><li>Also, put some files to hadoop file system. For the example, putting log files from host machine to hadoop file system.</li></ul><pre>hdfs dfs -put /var/log/* /logs/ </pre><p>You can also verify the above files and directory in the Hadoop web interface.</p><p>Go to the web interface, click on the Utilities =&gt; Browse the file system. You should see your directories which you have created earlier in the following screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiJT2lRHOV9dWuHlZHnTvA.png" /></figure><h3>Step 14 : To stop hadoop services :</h3><p>To stop the Hadoop service, run the following command as a hadoop user:</p><pre>stop-all.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xY60RXYY_-oHarUIdYGF5Q.png" /></figure><p>This tutorial explained to you step-by-step tutorial to install and configure Hadoop on Ubuntu 23.04 Linux system.</p><h3>Conclusion:</h3><p>In summary, you’ve learned how to install Hadoop on Ubuntu. Now, you’re ready to unlock the potential of big data analytics. Happy exploring!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ffdc0204357" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>