How to install Hadoop?

QuestionsQuestions8 SkillsProYour First Linux LabOct, 17 2025
097

To install Hadoop, follow these steps:

  1. Prerequisites:

    • Ensure you have Java installed (Java 8 or later).
    • Set the JAVA_HOME environment variable.
  2. Download Hadoop:

    wget https://downloads.apache.org/hadoop/common/hadoop-x.y.z/hadoop-x.y.z.tar.gz

    Replace x.y.z with the desired version number.

  3. Extract the downloaded file:

    tar -xzvf hadoop-x.y.z.tar.gz
  4. Move to the desired directory:

    mv hadoop-x.y.z /usr/local/hadoop
  5. Set environment variables:
    Add the following lines to your .bashrc or .bash_profile:

    export HADOOP_HOME=/usr/local/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin
    export JAVA_HOME=/path/to/java
  6. Source the profile:

    source ~/.bashrc
  7. Configure Hadoop:
    Edit the configuration files in the $HADOOP_HOME/etc/hadoop directory:

    • core-site.xml
    • hdfs-site.xml
    • mapred-site.xml
    • yarn-site.xml
  8. Format the NameNode:

    hdfs namenode -format
  9. Start Hadoop:

    start-dfs.sh
    start-yarn.sh
  10. Verify Installation:
    Check if Hadoop is running:

    jps

This should show the Hadoop daemons running, such as NameNode, DataNode, ResourceManager, and NodeManager.

0 Comments

no data
Be the first to share your comment!