开始接触Hadoop,听人说一般都是在Lunix下部署Hadoop,但是本人Lunix不是很了解,所以Google以下如何在Win10下安装Hadoop(之后再在Lunix下弄),找到不少文章,以下是主要参考的文章:
1、Hadoop installation on windows without cygwin in 10 mints
2、Win10系统安装Hadoop与Hbase
3、Apache Hadoop for Windows Platform
这里是按照第一篇文章操作的。
一、安装jdk,,地址为 具体的操作以及配置环境变量这里就不演示了,这里有一点需要注意的是默认会安装在C:\Program Files 下,开始我也是安装在这里,但是后来报错了,报什么“JAVA_HOME”的错误具体的记不清了。查了一下说是因为安装路径中有空格,晕了,所以安装在如下目录:
二、下载Hadoop,地址为 https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/stable/ 这里选择的是hadoop-2.7.3.tar.gz
三、将其解压到某一文件夹,这里为D:\hadoop\hadoop-2.7.3
四、添加“HADOOP_HOME”环境变量,并添加到Path环境变量中,按照下图操作
五、修改Hadoop配置文件,在这之前你要先下载sardetushar_gitrepo_download ,之后解压,删掉D:\hadoop\hadoop-2.7.3目录下的bin、etc文件夹,用刚刚解压的替换。
1、D:\hadoop\hadoop-2.7.3\etc\hadoop\core-site.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="http://www.mamicode.com/configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property> </configuration>
View Code2、D:\hadoop\hadoop-2.7.3\etc\hadoop\mapred-site.xml
<configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration>
View Code3、D:\hadoop\hadoop-2.7.3\etc\hadoop\hdfs-site.xml
这个配置这里要感谢一下这篇帖子: 按照第一篇教程配置会出错的!!!
<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>hadoop/data/namenode</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>hadoop/data/datanode</value> </property> </configuration>
View Code4、D:\hadoop\hadoop-2.7.3\etc\hadoop\yarn-site.xml