线程“main”org.apache.hadoop.ipc.remoteexception中的java异常:服务器ipc版本9无法与客户端版本4通信如何解决?

n53p2ov0  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(404)

我正在使用hadoop2.7.0和javaoraclejdk1.7.0\u79以及netbeanside8.0.2。当我尝试使用java文件与hadoop通信时,出现以下错误。是否涉及依赖性问题?或者如何解决此错误?
我看到过相关的帖子,但没有一个能帮助我清楚地传达答案。所以,请帮帮我。谢谢!

Exception in thread "main" org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4
at org.apache.hadoop.ipc.Client.call(Client.java:1066)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
at com.sun.proxy.$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.hdfs.DFSClient.createRPCNamenode(DFSClient.java:118)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:222)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:187)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1328)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:65)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1346)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:244)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(FileInputFormat.java:352)
at pir.PIR.run(PIR.java:317)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at pir.PIR.main(PIR.java:256)
14ifxucb

14ifxucb1#

如果您使用的是maven,那么请检查pom文件中包含的hadoop客户端的版本。它可能比集群上当前运行hadoop的版本旧(应该是2.7.0)

<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>2.7.0</version>
</dependency>

相关问题