1. HDFS客户端环境准备
(1) 下载hadoop client 包并解压到一个无中文无空格的目录下 :
链接:https://pan.baidu.com/s/1aYt3IHMYTO10XLzURkODlg
提取码:3e4m
(以上包是win10 的其它系统需要自己下载)
(2) 配置HADOOP_HOME环境变量
(3) 创建一个Maven工程HdfsClientDemo
(4) 导入相应的依赖坐标+日志
pom.xml文件添加:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.7.2</version