Installing Hadoop on MAC
Installing Hadoop on macOS involves several steps, including downloading Hadoop, configuring it, and setting up the necessary environment variables. Here’s a step-by-step guide to installing Hadoop on macOS:
Prerequisites:
- macOS (tested on macOS 10.15 Catalina)
- Homebrew (a package manager for macOS)
Step 1: Install Homebrew (if not already installed)
If you don’t have Homebrew installed, you can do so by opening Terminal and running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow the instructions in the Terminal to complete the installation.
Step 2: Install Java
Hadoop requires Java, so you’ll need to install the Java Development Kit (JDK). You can use Homebrew to install OpenJDK:
brew install openjdk@8
Step 3: Download and Configure Hadoop
Download Hadoop: You can download Hadoop from the Apache Hadoop website. Make sure to choose the version you want to install. For example, if you want to install Hadoop 3.3.1, you can download it with:
bashwget https://downloads.apache.org/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz
After downloading, extract the tarball:
bashtar -xzvf hadoop-3.3.1.tar.gz
You can also use a web browser to download and extract the tarball manually.
Configure Hadoop: Next, navigate to the Hadoop directory and configure it. Open the
hadoop-env.sh
file for editing:bashcd hadoop-3.3.1/etc/hadoop nano hadoop-env.sh
Find the line that sets
export JAVA_HOME
and set it to your JDK path. It should look like this:bashexport JAVA_HOME=/usr/local/opt/openjdk@8
Save and exit the editor.
Step 4: Set Environment Variables
To make Hadoop and its utilities available system-wide, add the following lines to your ~/.bash_profile
or ~/.zshrc
file (depending on your shell):
export HADOOP_HOME=/path/to/hadoop-3.3.1
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
Replace /path/to/hadoop-3.3.1
with the actual path to your Hadoop installation.
After making these changes, either restart your terminal or run source ~/.bash_profile
(or source ~/.zshrc
) to apply the changes.
Step 5: Test Your Hadoop Installation
To verify that Hadoop is installed correctly, you can run some Hadoop commands. For example:
Check Hadoop version:
bashhadoop version
Run a sample MapReduce job:
bashhadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-exampl
Hadoop Training Demo Day 1 Video:
Conclusion:
Unogeeks is the No.1 IT Training Institute for Hadoop Training. Anyone Disagree? Please drop in a comment
You can check out our other latest blogs on Hadoop Training here – Hadoop Blogs
Please check out our Best In Class Hadoop Training Details here – Hadoop Training
Follow & Connect with us:
———————————-
For Training inquiries:
Call/Whatsapp: +91 73960 33555
Mail us at: info@unogeeks.com
Our Website ➜ https://unogeeks.com
Follow us:
Instagram: https://www.instagram.com/unogeeks
Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute
Twitter: https://twitter.com/unogeeks