解决:Server IPC version 9 cannot communicate with client version 4

Posted 不自然地坚持

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决:Server IPC version 9 cannot communicate with client version 4相关的知识,希望对你有一定的参考价值。

使用idea的maven项目运行mapreduce程序Server IPC version 9 cannot communicate with client version 4

原因:

Java初始化hdfs client时出现的,原因是maven依赖的版本和hdfs的版本不一致

maven仓库中的hadoop-core最高只有1.2.1版本, 不能加这个配置, 使用hadoop-common + hadoop-hdfs + hadoop-client的2.7.1版本即可

我的pom文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>hadoop01</groupId>
    <artifactId>hadoop01</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <!--<dependency>-->
            <!--<groupId>org.apache.hadoop</groupId>-->
            <!--<artifactId>hadoop-core</artifactId>-->
            <!--<version>1.2.1</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.7.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-hdfs</artifactId>
            <version>2.7.1</version>
        </dependency>


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

        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <excludeTransitive>false</excludeTransitive>
                    <stripVersion>true</stripVersion>
                    <outputDirectory>./lib</outputDirectory>
                </configuration>

            </plugin>
        </plugins>
    </build>
</project>

 

以上是关于解决:Server IPC version 9 cannot communicate with client version 4的主要内容,如果未能解决你的问题,请参考以下文章

RPi 2B IPC webcam server

Hadoop HA HDFS启动错误之org.apache.hadoop.ipc.Client: Retrying connect to server问题解决

org.apache.hadoop.ipc.Client: Retrying connect to server异常的解决

原生 C/C++ 和 C# (.NET) 之间最轻量的 IPC 解决方案是啥?

IPC浅析Binder进程通信和ServiceManager

Perl:使用 IPC::Shareable 池化 Net::Server 连接