0% found this document useful (0 votes)
7 views2 pages

Setting Up Hadoop 3.3.1 Environment

This tutorial sheet provides instructions for setting up a local environment to run a WordCount example using Apache Hadoop 3.3.1. It includes steps for downloading and installing Java 8, Eclipse IDE, and Hadoop, as well as running the WordCount example with specific commands. Users are guided through the process of configuring environment variables and managing project files in Eclipse.

Uploaded by

dimaj91477
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Setting Up Hadoop 3.3.1 Environment

This tutorial sheet provides instructions for setting up a local environment to run a WordCount example using Apache Hadoop 3.3.1. It includes steps for downloading and installing Java 8, Eclipse IDE, and Hadoop, as well as running the WordCount example with specific commands. Users are guided through the process of configuring environment variables and managing project files in Eclipse.

Uploaded by

dimaj91477
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CS 838: Cloud Computing (Term II 2021-22)

Dr. Vinu Venugopal, Nithya Ganesan & Akshay Sujith


Tutorial Sheet #1

This tutorial sheet aims to help you in setting up your working environment on a local computer (such as
a laptop or PC) and to run your first WordCount example in a local installation of Apache Hadoop 3.3.1.

Set Up Your Local Working Environment

1. Download and install Java 8 (JDK 1.8) by choosing the respective installer binaries from:
[Link]
• Linux users can directly download the jdk-<version>-[Link] package, unpack
the tar archive, and install the JDK with: tar -zxvf jdk-<version>-[Link]
• Windows users have to run the installation binaries and then add the bin folder with the java
binary of their JDK installation to the front of their PATH variable under the Windows System
Variables.
• MacOS users can simply click on the downloaded .dmg file and install the application.
Make sure that your JAVA HOME environment variable points to your installation directory of Java 8.
2. Download and install Eclipse (Eclipse IDE for Java Developers) by choosing the respective installer
binaries from: [Link]

• Linux users can install Eclipse using sudo tar -xzvf <path to the downloaded package>
• Windows users simply unzip the downloaded file into a directory of your choice. There is no
need to run any installer.
• MacOS users can simply double-click the downloaded .dmg file and follow the screen instructions
to install Eclipse.

3. Download and install Hadoop 3.3.1 by choosing a respective mirror with the [Link]
binaries from: [Link]
Unpack the tar archive and make sure that your HADOOP HOME environment variable points to your
installation directory of Hadoop. Additionally verify that your PATH environment variable contains
the bin directory in which your hadoop binary is located.

1
CS 838: Cloud Computing (Term II 2021-22)
Dr. Vinu Venugopal, Nithya Ganesan & Akshay Sujith
Tutorial Sheet #1

Run the WordCount Examples in Apache Hadoop

1. Download the [Link] file from Moodle and extract the tar archive into a
local directory.
2. Download the [Link] class from Moodle and put them into a new Java project in your
Eclipse IDE for Java.

3. Import the [Link] and [Link] libraries


from your local Hadoop installation (located in the ./share/hadoop/common and ./share/hadoop/
mapreduce subdirectories of your HADOOP HOME installation directory) as external jars into the Java
build path of your Eclipse project.
4. Export your Java project into a single jar file called [Link] from your Eclipse IDE to a
local folder.

5. Run the WordCount example by typing


hadoop jar [Link] WordCount <input directory> <output directory>
where <input directory> is the directory containing your Wikipedia articles and <output directory>
is a new directory that will contain the output of your WordCount example.

Common questions

Powered by AI

On Linux, users download the hadoop-3.3.1.tar.gz package and unpack the tar archive to install Hadoop. On Windows, users perform a similar unpacking process but must ensure that the PATH environment variable includes the bin directory with the Hadoop binary. MacOS users would typically follow a similar unpacking procedure as Linux. Despite different methods of reaching the binary installation, a shared post-installation step across all platforms is verifying that the HADOOP_HOME environment variable points to the Hadoop installation directory . This ensures that related software can locate the installation for execution.

Eclipse IDE plays a critical role in developing and running Hadoop projects like WordCount by providing a robust development environment with features tailored for Java projects. It helps organize code into projects, facilitates the integration of external libraries needed for Hadoop operations (such as hadoop-common and hadoop-mapreduce-client-core), and streamlines the process of building the Java source code into an executable JAR file. Eclipse’s debugging and project management capabilities are particularly helpful for managing dependencies and resolving compatibility issues, which are common in complex setups involving multiple external libraries. Exporting the project as a JAR provides a convenient way to bundle and deploy Java applications, making it easy to run the application on the Hadoop framework .

To set up a local working environment for running the WordCount example in Apache Hadoop 3.3.1, you must complete the following steps: 1) Download and install Java 8 (JDK 1.8) specific to your operating system, ensuring that the JAVA_HOME environment variable points to the Java installation directory. 2) Download and install Eclipse for Java Developers, choosing the appropriate installer for your OS. There is no installation for Windows; files are simply unzipped into a chosen directory. 3) Download and install Hadoop 3.3.1, unpack the tar archive, and ensure the HADOOP_HOME environment variable points to the Hadoop installation directory. The PATH environment variable must include the bin directory containing the Hadoop binary . Environment variables like JAVA_HOME and HADOOP_HOME are crucial as they define where Java and Hadoop are installed, ensuring that software requiring these dependencies can access them correctly.

Running the WordCount example involves several steps, each critical to processing data within the Hadoop framework: 1) First, the Wikipedia-50-ARTICLES.tar.gz file is downloaded and extracted into a local directory, providing raw data for input. 2) The WordCount.java class is downloaded and integrated into a new Eclipse Java project. 3) Hadoop libraries such as hadoop-common-3.3.1.jar and hadoop-mapreduce-client-core-3.3.1.jar are imported as external jars into the Java build path, ensuring necessary Hadoop functions are included during execution. 4) The project is then exported into a single jar file called WordCount.jar, compiling the code and dependencies into an executable format. 5) Finally, the WordCount example is executed using a Hadoop jar command, specifying input and output directories; this directs Hadoop to use its MapReduce capabilities to process the input data and generate output results . Each step ensures that both data and processing resources are correctly assembled and executed in a distributed manner using Hadoop's capabilities.

You might also like