0

I am new to hadoop and I trying to understand if it is possible to connect to either remote or local jobtracker, I need this because I want identify the task that Hadoop is currently executing, I am trying this sample I found:

public class MyTracker {

    MyTracker(){
        try{
            inetAddress = new InetSocketAddress(InetAddress.getByName("localhost"), 50030);
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }

    InetSocketAddress inetAddress = null;

    public static void main(String[] args) {

        MyTracker myTracker = new MyTracker();
        myTracker.createJobTracker();
    }

    public void createJobTracker(){

        Configuration conf = new Configuration();

        try {
            JobClient jobClient = new JobClient(inetAddress, conf);
            JobStatus[] activeJobs = jobClient.jobsToComplete();

            for(int i = 0 ; i < activeJobs.length; i++){
                System.out.println(activeJobs[i]);
            }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

When I run this code I got this error:

java.io.IOException: Call to localhost/127.0.0.1:50030 failed on local exception: java.io.EOFException
at org.apache.hadoop.ipc.Client.wrapException(Client.java:775)
at org.apache.hadoop.ipc.Client.call(Client.java:743)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220)
at org.apache.hadoop.mapred.$Proxy0.getProtocolVersion(Unknown Source)

Please, help me understand what I am missing.

harpun
  • 4,022
  • 1
  • 36
  • 40
  • Which part of your code is Line 775 of the file "Client.java"? Thanks! – Alvin Bunk Feb 03 '14 at 21:40
  • You have a version mismatch between your cluster and your local application. – Thomas Jungblut Feb 03 '14 at 23:12
  • Hi Alvin,Client.java a Hadoop API, I am not working there – user3267574 Feb 04 '14 at 15:55
  • Hi Thomas, you are right, I changed the hadoop.jar and it goes through that step, I am getting a different error now, but I believe it is better to open another thread for that. – user3267574 Feb 04 '14 at 20:21
  • actually, the error is not really resolved, when I changed the hadoop.jar I started getting error regarding missing classes, after fixing those error I am back to original error, any other idea on how to fix? – user3267574 Feb 05 '14 at 23:40
  • I am saying that I have the same version because I am using hadoop that is shipped with infosphere biginsight and I am using its jar to compile my code, thanks – user3267574 Feb 05 '14 at 23:41

1 Answers1

0

I was able to run it and it indeed had a version missmatch plus this

Jobtracker API error - Call to localhost/127.0.0.1:50030 failed on local exception: java.io.EOFException

because I was trying to connect to port 50030 when I should connect to port 9001 as described in that thread.

thanks

Community
  • 1
  • 1