Thursday, July 16, 2015

Installing Hadoop-1.x.x in Pseudo-Distributed Mode

Disclaimer: The installation steps shared in this blog post are typically for the hadoop-1.x.x series. If you are looking for hadoop-2.x.x series installation steps i.e. with YARN, this post isn’t the right place.

Hadoop installation can be done in the following three modes. This post elaborates the Pseudo-Distributed Mode.
  • Standalone Mode
In this mode Hadoop is configured to run in a non-distributed mode, as a single Java process. This is useful for debugging. This is the default mode for Hadoop.
  • Pseudo-Distributed Mode
Hadoop can also be run on a single-node in a pseudo-distributed mode where each Hadoop daemon runs in a separate Java process. Such a mode is called Pseudo-Distributed mode.
  • Fully-Distributed Mode
In this mode we install, configure and manage non-trivial Hadoop clusters ranging from a few nodes to extremely large clusters with thousands of nodes.

Supported Platforms


GNU/Linux is supported as a development and production platform.
Win32 is supported as a development platform. Distributed operation has not been well tested on Win32, so it is not supported as a production platform.

Required Software


Required software for Linux and Windows include:
  • JavaTM 1.6.x, preferably from Sun, must be installed.
  • ssh must be installed and sshd must be running to use the Hadoop scripts that manage remote Hadoop daemons.
  • Additional requirements for Windows includes Cygwin. Its required for shell support in addition to the required software above.

Installing Software

If your cluster doesn't have the requisite software you will need to install it.

          For example on Ubuntu Linux:


$ sudo apt-get install ssh
$ sudo apt-get install rsync                      

On Windows, if you did not install the required software when you installed cygwin, start the cygwin installer and select the packages:
          openssh - the Net category

Download Hadoop


Obtain a Hadoop-1.x.x stable release from http://hadoop.apache.org/releases.html
  • Unpack the downloaded Hadoop distribution. In the distribution, edit the file conf/hadoop-env.sh to define at least JAVA_HOME to be the root of your Java installation.
  • Try the following command:

$ bin/hadoop                                                      

        This will display the usage documentation for the hadoop script.
  • Now you are ready to start your Hadoop cluster in one of the three supported modes:
  1. Local (Standalone) Mode
  2. Pseudo-Distributed Mode
  3. Fully-Distributed Mode
For the Pseudo-Distributed Mode we need to configure 3 files namely: 


  • conf/core-site.xml
<configuration>  
      <property>     
            <name>fs.default.name</name>
            <value>hdfs://localhost:9000</value>                                                                     
      </property>
 </configuration>
  • conf/hdfs-site.xml
<configuration>
      <property>
            <name>dfs.replication</name>    
             <value>1</value>   
      </property>
</configuration>
  • conf/mapred-site.xml
    <configuration>   
         <property>     
              <name>mapred.job.tracker</name>     
              <value>localhost:9001</value>   
          </property>
    </configuration>


Setup Passphraseless SSH


          We need to ssh to the localhost without a passphrase:
             $ ssh localhost 
          If you cannot ssh to localhost without a passphrase, execute the following commands:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
(This command generates a public key on the system and stores it on ~/.ssh/id_dsa)
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
(This command copies the public key to the set of authorized keys of the system)
This completes the ssh passphraseless setup process.


Start n Stop the Cluster

  • Format a new distributed-file system:
$ bin/hadoop namenode -format
  • Start the hadoop daemons:
$ bin/start-all.sh
  •  Accessible UI
NameNode UI Port - 50070
JobTracker UI Port – 50030
  • Stop the hadoop daemons:
$bin/stop-all.sh


8 comments:

  1. Managing a business data is not an easy thing, it is very complex process to handle the corporate information both Hadoop and cognos doing this in a easy manner with help of business software suite, thanks for sharing this useful post….
    Regards,
    cognos tm1 Training in Chennai|cognos Certification|Best COGNOS Training Institute in Chennai

    ReplyDelete
  2. Maharashtra Police Patil Recruitment 2016

    Thanks for posting the exact details,its really a good information...........

    ReplyDelete
  3. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating Hadoop Admin online training

    ReplyDelete
  4. I really thank you for your innovative post.I have never read a creative ideas like your posts.here after i will follow your posts which is very much help for my career.
    german speaking classes in bangalore
    german coaching centers in bangalore
    German Training in Mogappair
    German Training in Nungambakkam

    ReplyDelete
  5. Thanks for your interesting ideas.the information's in this blog is very much useful
    for me to improve my knowledge.
    vmware training in bangalore
    vmware courses in bangalore
    vmware Training in Anna Nagar
    vmware Training in Tnagar

    ReplyDelete
  6. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.vmware training in bangalore

    ReplyDelete