How to Install Hadoop on Mac Mojave 10.14

Configuration

  1. Configuration for Pseudo-Distributed mode
    nano /usr/local/hadoop/conf/core-site.xml

    And this is Content Should Looks Like:

     
     
     hadoop.tmp.dir
     /usr/local/hadoop/tmp
     
     
     fs.default.name
     hdfs://localhost:8020
     
     
    

    Next:

    nano /usr/local/hadoop/conf/hdfs-site.xml

    So the Content Should Looks Like:

     
     
     dfs.replication
     1
     
     
     
     dfs.name.dir
     /usr/local/hadoop/cache/hadoop/dfs/name
     
     
    

    Last:

    nano /usr/local/hadoop/conf/mapred-site.xml

    The Content Should Look Like:

     
     
     mapred.job.tracker
     localhost:8021
     
     
    
  2. SetUp Local Path & Environment

    exit
    nano $HOME/.bashrc

    Append:

    HADOOP_HOME=/usr/local/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
    

    The JAVA_HOME is Set Following Oracle Java JDK7+ Installation Version…
    Then Load New Setup:

    bash
  3. So to SetUp Needed Local SSH Connection
    Enable SSH Connection:

    System Preferences >> Sharing

    Apache Hadoop Installation on Mac Mojave 10.14 - Enabling Remote Login
    To Enable SSH Login without Pass:

    ssh-keygen -t rsa

    Press enter for each line…

    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
    chmod og-wx ~/.ssh/authorized_keys

    Testing Connection:

    ssh 127.0.0.1
    exit
  4. Then for Formatting HDFS

    cd /usr/local/hadoop
    sudo su
    bin/hadoop namenode -format

    Apache Hadoop Installation on Mac Mojave 10.14 - Terminal Apache Hadoop HDFS Formatting Succcess

Contents