Setting Up Hadoop 3.3.1 Environment
Setting Up Hadoop 3.3.1 Environment
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.