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

I am trying to connect my jobtracker using Java.
Below is the program I'm trying to execute

public static void main(String args[]) throws IOException { Configuration conf = new Configuration(); conf.addResource(new Path( "/home/user/hadoop-1.0.3/conf/core-site.xml")); conf.addResource(new Path( "/home/user/hadoop-1.0.3/conf/hdfs-site.xml")); conf.addResource(new Path( "/home/user/hadoop-1.0.3/conf/mapred-site.xml")); InetSocketAddress jobtracker = new InetSocketAddress("localhost", 50030); JobClient jobClient = new JobClient(jobtracker, conf); jobClient.setConf(conf); JobStatus[] jobs = jobClient.jobsToComplete(); for (int i = 0; i < jobs.length; i++) { JobStatus js = jobs[i]; if (js.getRunState() == JobStatus.RUNNING) { JobID jobId = js.getJobID(); System.out.println(jobId); } } 

This is the exception that I get. Even if I try to replace localhost 127.0.0.1, it does not work, same error.

  Exception in thread "main" 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:1107) at org.apache.hadoop.ipc.Client.call(Client.java:1075) at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225) at org.apache.hadoop.mapred.$Proxy1.getProtocolVersion(Unknown Source) at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396) at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379) at org.apache.hadoop.mapred.JobClient.createRPCProxy(JobClient.java:480) at org.apache.hadoop.mapred.JobClient.<init>(JobClient.java:534) at com.tcs.nextgen.searchablemetadata.executor.factory.JobChecker.main(JobChecker.java:34) Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:375) at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:811) at org.apache.hadoop.ipc.Client$Connection.run(Client.java:749) 

I added all banks related to hadoop. I can not understand why the "/" occurs between localhost / 127.0.0.1: 50030

+4
source share
1 answer

Have you tried the actual jobtracker port number and not the http port (50030).

Try specifying the port number specified in your $ HADOOP_HOME / conf / mapred-site.xml file under the mapred.job.tracker property. Here is my pseudo-mapred-site.xml conf

 <property> <name>mapred.job.tracker</name> <value>localhost:9001</value> </property> 

If you look at the JobTracker.getAddress(Configuration) method, you will see that it uses this property if the jobtracker host / port is not explicitly specified:

 public static InetSocketAddress getAddress(Configuration conf) { String jobTrackerStr = conf.get("mapred.job.tracker", "localhost:8012"); return NetUtils.createSocketAddr(jobTrackerStr); } 
+5
source

Source: https://habr.com/ru/post/1438817/


All Articles