Pages

Friday, February 15, 2013

Installing hadoop-1.0.4 on Mac (OS-10.7) for a Single Node



Using the steps given in this post and this excellent guide by Brandon Werner, you can install hadoop-1.0.4 (latest by now) on your mac( iOS-10.7). I will be just adding/modifying some steps (mentioned with the same title) which troubled me to google for those issues. You better follow the other link and when you face some trouble, come back here and see the solution.
  
Getting Java

<same> 

Setting up Environment
 
.bash_profile file was not present under my home directory, so I had to create a new file and edit it. So use following commands to create and modify that file. 

$ touch .bash_profile
$ open -a TextEdit.app .bash_profile

 <rest is same as given in other link>

Downloading Hadoop 

Download 1.0.4.tar.gz file from Apache website and type

$ sudo cp ~/Downloads/hadoop-1.0.4.tar.gz /usr/local/hadoop-1.0.4.tar.gz

$ sudo tar -xvzf hadoop-1.0.4.tar.gz

$ sudo mv ./hadoop-1.0.4 ./hadoop

Configuring: hadoop-env.sh  

Directory name is changed from 'config' to 'conf' in 1.0.4. Rest just follow the steps as given and make a fix for Lion iOS.

Configuring: *-site.xml files  

Remember to open all the files using "sudo vi ..."  and texteditor/root user/sudo chown wont work for this purpose.
 
Setup HDFS for the first time

Make sure 'Remote Login' is enabled in System Preferences->Sharing->Remote Login on your system otherwise you will get an error that Port-22 is closed.

Rest format your HDFS system with the steps given in that link and you better do with #root login.

Startup Hadoop with the Included Scripts

Run start-all.sh script as given. If you see some exception, log in as root and do the following.

# cd /usr/local/hadoop

# bin/stop-all.sh
# bin/hadoop namenode -format
# bin/start-all.sh
If it asks for the password during starting of daemons, given root password.
Rest you can run WordCount example as given in that link.
 Happy hadooping =)

No comments:

Post a Comment