使用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的更多相关文章

  1. bug--java访问hdfs (Server IPC version 9 cannot communicate with client version 4 错误)

    1. 今天想做一个hdfs的java工具类,但是在连接hdfs的时候,报如下错误: Exception in thread "main" org.apache.hadoop.ipc ...

  2. maven在Idea建立工程,运行出现Server IPC version 9 cannot communicate with client version 4错误

    问题的根源在于,工程当中maven dependencies里面的包,有个hadoop-core的包,版本太低,这样,程序里面所有引用到org.apache.hadoop的地方,都是低版本的,你用的是 ...

  3. Android系统进程间通信(IPC)机制Binder中的Client获得Server远程接口过程源代码分析

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6633311 在上一篇文章中,我 们分析了And ...

  4. 解决CUDA driver version is insufficient for CUDA runtime version

    问题 在服务器上安装mxne的GPU版本 sudo pip install mxnet-cu80==1.2.1 然后在gpu上创建数据 import mxnet as mx mx.nd.array([ ...

  5. 解决Maven 报 Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE. 的错误

    最近在搭建公司的基础框架,业务需求用到elasticsearch,所以需要整合到基础框架里,供各业务线使用同时也便于管理,但在整合的过程中,出现了莫名的问题,同时maven的提示也不够明确. 我的版本 ...

  6. Laravel - 解决连接MySQL时报"The server requested authentication method unknown to the client”错误

    2019-04-12发布:hangge阅读:934   1,问题描述 最近建了个 Laravel 项目,当配置好 MySQL 数据库进行请求时,页面报如下错误:   SQLSTATE[HY000] [ ...

  7. coreseek 提示 client version is higher than daemon version 解决办法

    安装好coreseek,开启了服务之后,通过 sphinx php扩展去请求数据,提示:client version is higher than daemon version (client is ...

  8. CUDA driver version is insufficient for CUDA runtime version 解决

    配置ubuntu17.1+CUDA9.2的caffe环境,CUDA sample编译完成,执行到./deviceQuery时报错:CUDA driver version is insufficient ...

  9. Visual Studio 2017 : client version 1.22 is too old

    使用Vs2017 编译 eShopOnContainers-ServicesAndWebApps 时,报了错误: Microsoft.DotNet.Docker.CommandLineClientEx ...

随机推荐

  1. Python 基础之python运算符

    一.运算符 1.算数运算符 + - * / // % ** var1 = 5var2 = 8 #(1)  + 加res = var1 + var2print(res) # (2)  -  减res = ...

  2. 40个超有趣的Linux命令行彩蛋和游戏

    40个有趣的Linux命令行彩蛋和游戏,让你假装成日理万机的黑客高手.附一键安装脚本,在树莓派和ubuntu云主机上亲测成功,有些还可以在Windows的DOS命令行中运行. 本文配套B站视频:40个 ...

  3. runas的替代品CPAU使用

    runas替代软件CPAU 在windows系统下,想要实现某个程序不论何时都以指定的用户身份登录,因此找到了CPAU这个软件 cpau官方网站:https://www.joeware.net/fre ...

  4. redis(笔记)

    ./redis-cli -a root 带密码链接 root 为我的密码del key 删除key keys * 查询 所有keyexist key key是否存在 成功返回1 失败Wie0 set ...

  5. 网络协议-restful协议

    REST Representational State Transfer, 是一种软件架构风格,提供一系列限制指导,用于更好的创建web service. 符合REST 架构风格的web servic ...

  6. lvextend 扩容后, df -h 看到的却还是原来的大小

    [root@stb ~]# df -hFilesystem                  Size  Used Avail Use% Mounted on/dev/mapper/vg_stb-lv ...

  7. ch8 faux列

    在一个布局中,假设有导航元素和内容元素,切给他们都分别应用了背景,理想情况下,背景应该拉长到整个布局的最大高度,从而形成列的效果,但是实际上,因为导航元素没有扩展到最大高度,所以它们的背景不会拉长,如 ...

  8. Celery的常用知识

    什么是Clelery   Celery是一个简单.灵活且可靠的,处理大量消息的分布式系统.专注于实时处理的异步任务队列.同时也支持任务调度. Celery的架构由三部分组成,消息中间件(message ...

  9. 简单看看ReentrantLock

    前面我们分析了AQS的基本原理,然后也试着基于AQS实现了一个可重入的锁了,现在我们再来看看官方的ReentrantLock锁,这个锁是可重入的独占锁,也就是说同时只有一个线程可以获取该锁,而且这个线 ...

  10. django的save方法被调用时数据是如何被保存的

    发送一个django.db.models.signals.pre_save信号,以允许监听该信号的函数完成一些自定义操作. 预处理数据.如果需要,对对象的每个字断进行自动转换. 准备数据库数据.要求咩 ...