Program 1
Steps to run
1. Create a New File named [Link]
2. Copy the Below code and Paste inside [Link] 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 [Link] File using following command source [Link].
4. Verify JAVA_HOME variable to be set to Java Path and PATH variable has your USN
Hadoop [Link] any previous PATH set to Hadoop Folder remove that inside .bashrc
file.
5. Verify Hadoop is Installed or not by executing hadoop [Link] command gives
Information about Hadoop command then Hadoop is Successfully Installed.
6. Create a folder code and move to that folder
7. Make the [Link] , [Link] and [Link] files
8. Compile all java files ([Link] [Link] [Link])
javac -d . *.java
9. Set driver class in manifest
echo Main-Class: [Link] > [Link]
10. Create an executable jar file
jar cfm [Link] [Link] weather/*.class
11. [Link] is input file for Weather create Input File
12. Run the jar file
hadoop jar [Link] [Link] output
13. To see the Output
cat output~/*
Code for driver,mapper and runner
[Link]
output
Program 2
Steps to run
1. Create a New File named [Link]
2. Copy the Below code and Paste inside [Link] 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 [Link] File using following command source [Link].
4. Verify JAVA_HOME variable to be set to Java Path and PATH variable has your USN
Hadoop [Link] any previous PATH set to Hadoop Folder remove that inside .bashrc
file.
5. Verify Hadoop is Installed or not by executing hadoop [Link] command gives
Information about Hadoop command then Hadoop is Successfully Installed.
6. Create a folder program2 and move to that folder
7. Make the [Link] , [Link] and [Link] files
8. Compile all java files ([Link] [Link] [Link])
javac -d . *.java
9. Set driver class in manifest
echo Main-Class: [Link] > [Link]
10. Create an executable jar file
jar cfm [Link] [Link] earthquake/*.class
11. [Link] is input file for earthquake create Input File
12. Run the jar file
hadoop jar [Link] [Link] output
13. To see the Output
cat output~/*
code for driver, mapper and runner
[Link] file
output :