Friday, 20 April 2012

Installing Apache Mahout on Ubuntu

Hi ..nice to see u guys in here.. the thought of putting in a tutorial came on to me when i had quite a tough time while installing Mahout.. its not difficult .. but u do get stuck at small itty bitty mistake u make while in the installing process or not knowing  the exact dependencies required.. which leads you to errors and then u end up in the game similar to a treasure hunt .. so lets start ..

Step 1: INSTALLATION OF  Sun JAVA JDK

this would look simple and quite a petty thing to do .. but if not done in the correct way leads to some major issues.. 

1. Install from Synaptic Package manager :

Most of us would be doing that .. which is fine..

Systems-Administration-Synaptic Package Manager-- install sun java jdk
 
but check the sun java update.. if the jdk is of older version it has got few bugs in it and installation of mahout gets into trouble ..thats what happened to me ..  so i installed   jdk1.6.0_26 manually the latest version from the following website

2.Installation of java manually

Java update 26 Download

1.Accept the license
2.Download the self extracting installer  file depending upoon 64 bit, 32 bit. or x86.
3.After the Download you would see a .bin file

 the way i have installed is

ganesh@ganesh-VPCEG2AEN:~$ mkdir programs
ganesh@ganesh-VPCEG2AEN:~$ cd programs
ganesh@ganesh-VPCEG2AEN:~/programs$ bash ../Downloads/jdk-6u26-linux-i586.bin


the above command would unpack and in the end it will ask you to press enter to continue..at that instance you need to press enter.


ganesh@ganesh-VPCEG2AEN:~/programs$ ln -s jdk1.6.0_26 jdk
ganesh@ganesh-VPCEG2AEN:~/programs$ ls -l
total 4
lrwxrwxrwx  1 ganesh ganesh   11 2012-04-12 13:55 jdk -> jdk1.6.0_26
drwxr-xr-x 10 ganesh ganesh 4096 2012-04-12 13:52 jdk1.6.0_26

ganesh@ganesh-VPCEG2AEN:~/programs$ cd ..




ganesh@ganesh-VPCEG2AEN:~/programs$ sudo gedit .bashrc


when the .bashrc file would open.. set the JAVA HOME by adding  the following lines

#Set Java Home
export JAVA_HOME=$HOME/programs/jdk
export PATH=.:$JAVA_HOME/bin:$PATH

once this is done u have finished the procedure of Downloading...Installing and Configuring.. to check if its installed or not.. follow the below command..

ganesh@ganesh-VPCEG2AEN:~$ java -version




you should get the following output

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)





once java is done we can now go further..........


STEP 2 : INSTALLATION OF MAVEN .

One can install maven from synaptic package manger or by running a command  

sudo apt-get install maven2

but here too i have installed Apache maven 3.0.4 manually by following the below mentioned procedure ...

  1. Extract the distribution archive, i.e. apache-maven-3.0.4-bin.tar.gz to the directory you wish to install Maven 3.0.4. These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.0.4 will be created from the archive.
  2. open the .bashrc file again ... and add the following lines 
############## Apache-Maven #########
export M2_HOME=/usr/local/apache-maven-3.0.4
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export JAVA_HOME=$HOME/programs/jdk

 3. Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.5.0_02 and that $JAVA_HOME/bin is in your PATH environment variablee. (which we have already done while installing JAVA)

4.Run mvn --version to verify that it is correctly installed.

one should get a display as shown below

Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: /usr/local/apache-maven-3.0.4
Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
Java home: /home/ganesh/programs/jdk1.6.0_26/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "2.6.35-22-generic", arch: "i386", family: "unix"



 ****note 
if you are getting connected through a proxy connection ,we need to change the proxy settings in settings file of maven .. until this is done  maven does not connect .. make sure this is done..

we need to change the settings in the settings.xml page in the conf direcotry of the apache maven, in my case 

ganesh@ganesh-VPCEG2AEN:~$ cd /usr/local/apache-maven-3.0.4
ganesh@ganesh-VPCEG2AEN:/usr/local/apache-maven-3.0.4$ cd conf
ganesh@ganesh-VPCEG2AEN:/usr/local/apache-maven-3.0.4/conf$ ls
settings.xml
ganesh@ganesh-VPCEG2AEN:/usr/local/apache-maven-3.0.4/conf$ sudo gedit settings.xml
 


once the settings.xml page opens 

<!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
    
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>put in your username</username>
      <password>put in your password</password>
      <host>put in the host address</host>
      <port>port </port>
      <nonProxyHosts>localhost</nonProxyHosts>
    </proxy>
   
  </proxies>
|-->




make sure to uncomment the code lines.
 


3.INSTALLATION OF HADOOP

the following website provides a beautiful tutorial of installing single node  hadoop cluster  

Single node hadoop cluster set up

*** make sure that u have installed ssh  or else you would get an error as

ganesh@ganesh-VPCEG2AEN:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused

so to avoid the above error

ganesh@ganesh-VPCEG2AEN:~$ sudo apt-get install openssh-server





 
 sTEP 4 ...finally to  INSTALLATION OF MAHOUT :

1. go to the following website  to download mahout source code 
   
     http://www.apache.org/dyn/closer.cgi/lucene/mahout/ 




select one of the mahout version which are 0.4 , 0.5 ,0.6 .. i had selected 0.6
and make sure that out of so many zipped files in there download the .src zipped file .. this is again the place were many of us make a mistake... 


2. check  if the folder has a pom.xml or not .. it would be there for sure but make sure u check once.


3. in my case i had Downloaded the file,unzipped it named it as mahout  and moved to /usr/local .

following are the commands

ganesh@ganesh-VPCEG2AEN:~$ cd /usr/local/mahout
ganesh@ganesh-VPCEG2AEN:/usr/local/mahout$ mvn install

you should see something as below :


 then it would perform the test ..  its recommended that the complete tests should be done and the process should be completed for the first time installation.. later when we run the mvn install we use a command to skip the tests which is  
mvn install -Dmaven.test.skip=true.
 
 
 

once the tests are done and the mahout is built .. we get a success msg as shown in the figure beow..


Congratulations mahout is installed...





Tuesday, 30 August 2011

My Fav Quotes

Life is all about Attitude and Passion.......


‎"I am thankful to all those who said no to me,its becasue of them i did it myself " - Albert Einstein


‎"Anyone who has never made a mistake has never tried anything new.


‎"Laughing Faces Do Not Mean That There Is Absence Of Sorrow! But It Means That They Have The Ability To Deal With It" - Shakespeare


‎"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."


"A Question that sometimes drives me hazy : Am I or are the others crazy ? ?"




"Small Aim is a Crime - Dr A P J Abdul Kalam."


"It's not that I'm so smart, it's just that I stay with problems longer."




Kuch kar guzarne ka junoon jahan hota hai
Wahan zindagi rehti hai, khuda hota hai
Justuju ho toh safar khatam kahan hota hai
Yun tu har modh pe manzil ka gumaah hota hai ---Roadies 8"



"I know where I'm going and I know the truth, and I don't have to be what you want me to be. I'm free to be what I want."


"Only a man who knows what it is like to be defeated can reach down to the bottom of his soul and come up with the extra ounce of    power it takes to win when the match is even."


‎'Aut viam inveniam aut faciam', which means 'I'll either find a way or make one."


"Nothing in this Universe happens just once,infinity goes in both directions there is no unique event,no singular moment..we would alaways get another chance in life if we really want it .... :)"



Every ship must sail away by Blue Merle

Have you ever heard the sounds
In the shadows of a song?
Have you ever felt the words
Blow right thru you from beyond?

cause years pass and people change
The bluest skys can turn to grey
And though it's gonna hurt for now
Every ship must sail away
Every ship must sail away
[ Lyrics from: http://www.lyricsmode.com/lyrics/b/blue_merle/every_ship_must_sail_away.html ]
Oh change is in the air
And you wear it oh so well
I asked you if you cared
If you cared I couldn't tell

'cause years pass and people change
The bluest skys can turn to grey
And though it's gonna hurt for now
Every ship must sail away
Every ship must sail away

And though it's gonna hurt for now
And though it's gonna hurt for now
And though it's gonna hurt for now
Every ship must sail away