Can the hadoop programm which write under the hado

2019-09-04 09:38发布

问题:

I have hadoop-2.2.0 in my PC and i have wrote a programme under this version. And now i need to test it in a big cluster, but in the hadoop in the cluster machine is hadoop-1.2.1. When I try to run my programm on it, there is an error:

java.lang.NoSuchMethodError: org/apache/hadoop/util/ProgramDriver.run([Ljava/lang/String;)I at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

I googled and it seems the problem of the version. So Is it not possible to run the programm wrote in new version of hadoop on old version hadoop? Thanks in advance!

回答1:

It depends on your Map Reduce program and what classes it uses(My gut feeling is that is does not work). Hadoop-1.x.x to 2.x.x is major release change, so there will be major changes in the classes and the libraries that you use in your program. Having said that I encourage you to check the release notes for the version.