Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:21+00:00 2026-06-14T21:01:21+00:00

I have written a Hadoop map-reduce program and now I want to test it

  • 0

I have written a Hadoop map-reduce program and now I want to test it on Cloadera Hadoop distribution that is running on the same computer in virtual box.

Here is how do I submit that map-reduce job:

public class AvgCounter extends Configured implements Tool{

    public int run(String[] args) throws Exception {
        Job mrJob = Job.getInstance(new Cluster(getConf()), getConf()); 
        mrJob.setJobName("Average count");

        mrJob.setJarByClass(AvgCounter.class);
        mrJob.setOutputKeyClass(IntWritable.class);
        mrJob.setOutputValueClass(Text.class);
        mrJob.setMapperClass(AvgCounterMap.class);
        mrJob.setCombinerClass(AvgCounterReduce.class);
        mrJob.setReducerClass(AvgCounterReduce.class);
        mrJob.setInputFormatClass(TextInputFormat.class);
        mrJob.setOutputFormatClass(TextOutputFormat.class);

        FileInputFormat.setInputPaths(mrJob, new Path("/user/test/testdata.csv"));
        FileOutputFormat.setOutputPath(mrJob, new Path("/user/test/result.txt"));
        mrJob.setWorkingDirectory(new Path("/tmp"));
        return mrJob.waitForCompletion(true)? 1: 0;
    }

    public static void main(String[] args) throws Exception {
        Configuration conf = new Configuration();
        conf.set("fs.defaultFS", "hdfs://192.168.5.50:9000");
        conf.set("mapreduce.jobtracker.address", "192.168.5.50:9001");
        System.exit(ToolRunner.run(conf, new AvgCounter(), args));
    }
}

AvgCounterMap has empty map method that does nothing as well as AvgCounterReduce has empty reduce method that does nothing. When I try to run the main method I get following exception:

Exception in thread "main" java.io.IOException: Call to /192.168.5.50:9001 failed on local exception: java.io.EOFException
    at org.apache.hadoop.ipc.Client.wrapException(Client.java:1063)
    at org.apache.hadoop.ipc.Client.call(Client.java:1031)
    at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:198)
    at $Proxy0.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:235)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:275)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:249)
    at org.apache.hadoop.mapreduce.Cluster.createRPCProxy(Cluster.java:86)
    at org.apache.hadoop.mapreduce.Cluster.createClient(Cluster.java:98)
    at org.apache.hadoop.mapreduce.Cluster.<init>(Cluster.java:74)
    at eu.xxx.mapred.AvgCounter.run(AvgCounter.java:22)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:69)
    at eu.xxx.mapred.AvgCounter.main(AvgCounter.java:53)
Caused by: java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:375)
    at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:760)
    at org.apache.hadoop.ipc.Client$Connection.run(Client.java:698) 

The virtual Cloudera machine that runs Hadoop has following in file /etc/hadoop/conf/core.site.xml

<property>
    <name>fs.default.name</name>
    <value>hdfs://192.168.5.50:9000</value>
</property> 

and in the file /etc/hadoop/conf/mapred.site.xml there is

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

I have also checked checked connection to virtual machine by writing 92.168.5.50:50030 to my web browser and I got Hadoop Map/Reduce administration as expected. So what is causeing that exception and how do I get rid of it?

Thank you for any ideas

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:01:22+00:00Added an answer on June 14, 2026 at 9:01 pm

    The problem was that client was using different version of Hadoop API (0.23.0) then the Hadoop instalation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written my own hadoop program and I can run using pseudo distribute
I have written a function that sorts a big scale of data. To test
I have written a Windows Forms application and now I want to write some
I have wriiten a simple hadoop job. Now I want to run it without
I have a sequential file which is the output of hadoop map-reduce job. In
I have written a hadoop 1.0.4 application that runs fine locally in semi-distributed mode.
I have written a java program generates lots of files (say txt files) in
I have written a function that extract the domain from hostname. e.g. www.domain.com ->
I have written a very simple CTE expression that retrieves a list of all
I have written custom delegate methods in ClassFile(B), now i am calling them from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.