Wednesday, February 8, 2017

How to install Apache Maven & Apache Hadoop in Ubuntu 16.04



In this article I  am going to discuss how to setup Maven and Hadoop. The steps for all two frameworks are always the same:

                    1.Decompress the archive
                    2.Add the correct console variable
                    3.Test the correctness of the installation

1. 1 Download Latest Maven binaries from apache site


First you have to go apache site using this link



You can download  latest version  of apache-maven-3.2.2 . You only have to click on the apache-maven-3.2.2-bin.tar.gz link. Then browser will automatically pop up window to download the file. 





1.2. Download Latest Hadoop from apache site


First you have to go apache site using this link





You can download  latest version  of hadoop-2.7.3. You only have to click on the hadoop-2.7.3.tar.gz link. Then browser will automatically pop up window to download the file. 




1.3 Then you can create folder named Hadoop (Folder name can be any one. I named folder as Hadoop :) ) in home directory . Then move downloded apache-maven-3.2.2-bin.tar.gz and hadoop-2.7.3.tar.gz  files from Downloads to newly created folder(Hadoop).


Next extract those files by right click on those files and select Extract Here. After that there are two files  named  apache-maven-3.2.2 and hadoop-2.7.3.

  

 2.1 We also need to have the  mvn command. The Hadoop command accessible from every terminal. To have this variable fixed even in case of a system reboot, we will save them in the bashrc file as well. 

There is an easy way in Ubuntu to set up variables for a single user.

2.2  To accomplish all these settings you need to:

 

Open the file named .bashrc using terminal. You have to type gedit ~/.bashrc  in terminal and enter. Then bashrc file will be opened.




2.3 Add the following lines at the end of the bashrc file according to your sytem:

 

 

export HADOOP_HOME=/home/kaveesh-pc/Hadoop/hadoop-2.7.3

export MAVEN_HOME=/home/kaveesh-pc/Hadoop/apache-maven-3.2.2

export PATH=$PATH:$MAVEN_HOME/bin:$HADOOP_HOME/bin

I placed hadoop-2.7.3 and apache-maven-3.2.2 in /home/kaveesh-pc/Hadoop directory. So my environment variables are like that. You just have to add your absolute path for each  hadoop-2.7.3 and  apache-maven-3.2.2 folder.



2.4 Save the file and return to the console.
The first two lines those are added to bashrc file ,create the user variables: MAVEN_HOME and HADOOP_HOME .

The last line couple those user variables(HADOOP_HOME and MAVEN_HOME)  with their relative bin locations to the PATH variable.


3  To test JDK and Maven, now type and enter the following command in terminal one by one:

 

         mvn –version
         hadoop version

You should received the following output:



If you like this post, spread by sharing it on social media. Thank you!





No comments:

Post a Comment

How to send Slack notification using a Python script?

 In this article,  I am focussing on sending Slack notifications periodically based on the records in the database. Suppose we have to monit...