Start off by installing the latest version of Hadoop because you’ll need the basic infrastructure in place no matter what version you want to use. You can find my tutorial on installing Hadoop on Yosemite using Homebrew here.
- Find the version of Hadoop you are specifically looking for, version 1.2.1 can be found here https://archive.apache.org/dist/hadoop/core/hadoop–1.2.1/
- Download the tar.gz file and unzip it.
- Copy the contents of the folder into /usr/local/Cellar/hadoop
- Now just start up your local hadoop configuration, using hstart we created in the introduction tutorial.
- Instead of doing the default hadoop jar … we directly execute the specific hadoop script that came with the new tar file. You can run the file either by
- /usr/local/hadoop/1.2.1/bin/hadoop jar ./target/wordcount.jar dataset1.txt $(date +%s)
- or to make it a little easier create a shell script called “setmeup” that will execute the command
- #/usr/local/Cellar/hadoop/1.2.1/bin/hadoop jar ./target/bdp-1.0.jar dataSet1.txt $(date +%s)
- After you create the script, do a chmod +x ./setmeup to make it an executable.
- run ./setmeup to execute the job.
- Notice this will produce output files directly in the build / run directory.