0% found this document useful (0 votes)
4 views6 pages

Output Tutorial1

The document provides step-by-step instructions for running two Hadoop programs, each requiring the creation of a Bash script to set environment variables and compile Java files. Users are guided to create input files, compile Java classes, and execute JAR files for both weather and earthquake data processing. It emphasizes verifying the installation of Hadoop and checking the output after execution.

Uploaded by

ramyan5598
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)
4 views6 pages

Output Tutorial1

The document provides step-by-step instructions for running two Hadoop programs, each requiring the creation of a Bash script to set environment variables and compile Java files. Users are guided to create input files, compile Java classes, and execute JAR files for both weather and earthquake data processing. It emphasizes verifying the installation of Hadoop and checking the output after execution.

Uploaded by

ramyan5598
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
You are on page 1/ 6

Program 1

Steps to run
1. Create a New File named Bash.sh
2. Copy the Below code and Paste inside Bash.sh and save that File.
export JAVA_HOME=$(readlink -f $(which javac) | awk 'BEGIN {FS="/bin"} {print
$1}')
export PATH=$(echo $PATH):$(pwd)/bin
export CLASSPATH=$(hadoop classpath)

3. Execute the bash.sh File using following command source Bash.sh.


4. Verify JAVA_HOME variable to be set to Java Path and PATH variable has your USN
Hadoop Folder.If any previous PATH set to Hadoop Folder remove that inside .bashrc
file.
5. Verify Hadoop is Installed or not by executing hadoop command.if command gives
Information about Hadoop command then Hadoop is Successfully Installed.
6. Create a folder code and move to that folder
7. Make the driver.java , mapper.java and reducer.java files
8. Compile all java files (driver.java mapper.java reducer.java)
javac -d . *.java
9. Set driver class in manifest
echo Main-Class: weather.driver > Manifest.txt
10. Create an executable jar file
jar cfm weather.jar Manifest.txt weather/*.class
11. input.txt is input file for Weather create Input File
12. Run the jar file
hadoop jar weather.jar input.txt output
13. To see the Output
cat output~/*
Code for driver,mapper and runner
input.txt

output
Program 2
Steps to run
1. Create a New File named Bash.sh
2. Copy the Below code and Paste inside Bash.sh and save that File.
export JAVA_HOME=$(readlink -f $(which javac) | awk 'BEGIN {FS="/bin"} {print
$1}')
export PATH=$(echo $PATH):$(pwd)/bin
export CLASSPATH=$(hadoop classpath)
3. Execute the bash.sh File using following command source Bash.sh.
4. Verify JAVA_HOME variable to be set to Java Path and PATH variable has your USN
Hadoop Folder.If any previous PATH set to Hadoop Folder remove that inside .bashrc
file.
5. Verify Hadoop is Installed or not by executing hadoop command.if command gives
Information about Hadoop command then Hadoop is Successfully Installed.
6. Create a folder program2 and move to that folder
7. Make the driver.java , mapper.java and reducer.java files
8. Compile all java files (driver.java mapper.java reducer.java)
javac -d . *.java
9. Set driver class in manifest
echo Main-Class: earthquake.driver > Manifest.txt
10. Create an executable jar file
jar cfm earthquake.jar Manifest.txt earthquake/*.class
11. input.csv is input file for earthquake create Input File
12. Run the jar file
hadoop jar earthquake.jar input.csv output
13. To see the Output
cat output~/*
code for driver, mapper and runner
input.csv file

output :

You might also like