WordCount: Java vs MapReduce
To run this application in a single node:
-
Install Hadoop, stable version recommended: http://www.apache.org/dyn/closer.cgi/hadoop/common/
-
Install Ant. In Ubuntu:
$ sudo apt-get install ant
- Set the environmental variable HADOOP_HOME pointing to the root Hadoop installation directory, e.g.:
$ export HADOOP_HOME=~/hadoop-0.20.203.0
- Edit the /conf/hadoop-env.sh by uncommenting the following line. In Mac OS X it is:
export JAVA_HOME=/Library/Java/Home
And setting your JAVA_HOME correctly.
-
Insert the plain text files you want to count words in the input/ directory
-
Run javaexec.sh and hadoopexec.sh and enjoy!