After setting up your hadoop cluster which we learnt in our earlier blogs( Pseudo Distributed Cluster, Fully Distributed Cluster), we now set up eclipse on ubuntu to develop Map Reduce programs for our Hadoop Cluster. Below are the steps to do so:
- Install Eclipse on ubuntu, by using $ sudo apt-get eclipse.
- Next step is to download the Hadoop Eclipse Plugin. Many tutorials suggest to build the plugin jar file Yourself using "ant". Trust me, this method is a quite messy and You may screwup Your hadoop install changing the various build.xml and build-properties.xml files. The best way is to directly download this jar file from here by clicking this line.
- Next copy the jar file to eclipse/plugins directory. Its going to be /usr/lib/eclipse/plugins in my case.
- Start eclipse, go to "Window >> Open Perspective >> Other". From perspectives window, you should see “Map/Reduce”, Select it and click "OK".
- You will see “Map/Reduce” perspective icon at the top right hand corner of the main eclipse panel now, as highlighted below.
- Also You see the Map/Reduce Locations tab at the bottom. Go to that tab and add a new location as shown below.
- In the details form, give any Location Name.Under the Map/Reduce Master section, fill in Host as your cluster's name node host name. In our case, its "master". The port is 9001. Under DFS Master, check the "Use M/R Master host" option and give port as 9000. Under User Name give Your hadoop install user name. Its "hduser" in our case. Now click finish.
- Now you should see Your newly set-up DFS Locations in project explorer.
Now you are all set with environment for development.