赞
踩
1.将在Linux系统中解压的hadoop版本(.gz后缀),解压到指定目录
2.配置HADOOP_HOME环境变量
(1)新建环境变量(我解压在F:/)
(2)Path变量
(3)检验:在dos窗口中输入hadoop
3.下载windows下连接hadoop需要的文件
文件链接:https://pan.baidu.com/s/15Ti2XAIJhXYtRyKUf1lYDA
提取码:zie1
(1)将hadoop.dll复制到C:\Windows\System32目录下
(2)将hadoop.dll和winutils.exe复制到F:\hadoop-2.6.0-cdh5.7.0\bin目录下
<dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-hdfs</artifactId> <version>${hadoop.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>${hadoop.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-jobclient</artifactId> <version>${hadoop.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-common</artifactId> <version>${hadoop.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency>
启动
在文件系统中可以看到目录已创建
3.报错权限不足
在FileSystem.get()方法中添加Linux系统的用户
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。