当前位置:   article > 正文

Windows11安装hadoop-3.3.0_win11安装hadoop3

win11安装hadoop3

一、安装Java

1. 下载Java

进入下载页面Java Archive Downloads - Java SE 8

Java SE Development Kit 8u191中

选择适合操作系统的下载文件

在安装好的路径下,将Java目录复制到C:\根目录下,形成C:\Java\jdk1.8.0_191目录结构

2. 设置环境变量

注意:要保证jdk所在的路径中不能包含空格,比如Program Files中间是有空格的,建议参照下图中的路径

 

二、安装Hadoop

1. 下载hadoop-3.3.0

进入下载页面

https://archive.apache.org/dist/hadoop/common/hadoop-3.3.0/

选择hadoop-3.3.0.tar.gz下载

https://archive.apache.org/dist/hadoop/common/hadoop-3.3.0/hadoop-3.3.0.tar.gz

解压到C:\hadoop-3.3.0目录,形成C:\hadoop-3.3.0\bin这种目录层次

2. 下载winutils替换hadoop-3.3.0\bin目录

下载winutils

https://github.com/s911415/apache-hadoop-3.1.0-winutils

将其中bin目录替换到C:\hadoop-3.3.0\下的bin目录

3. 设置环境变量

4. 修改配置

C:\hadoop-3.3.0\etc\hadoop目录下有4个配置文件

C:\hadoop-3.3.0\etc\hadoop\core-site.xml

  1. <configuration>
  2. <property>
  3. <name>fs.default.name</name>
  4. <value>hdfs://localhost:9820</value>
  5. </property>
  6. </configuration>

C:\hadoop-3.3.0\etc\hadoop\hdfs-site.xml

  1. <configuration>
  2. <property>
  3. <name>dfs.replication</name>
  4. <value>1</value>
  5. </property>
  6. <property>
  7. <name>dfs.namenode.name.dir</name>
  8. <value>file:///C:/hadoop-3.3.0/data/dfs/namenode</value>
  9. </property>
  10. <property>
  11. <name>dfs.datanode.data.dir</name>
  12. <value>file:///C:/hadoop-3.3.0/data/dfs/datanode</value>
  13. </property>
  14. </configuration>

C:\hadoop-3.3.0\etc\hadoop\mapred-site.xml

  1. <configuration>
  2. <property>
  3. <name>mapreduce.framework.name</name>
  4. <value>yarn</value>
  5. <description>MapReduce framework name</description>
  6. </property>
  7. </configuration>

C:\hadoop-3.3.0\etc\hadoop\yarn-site.xml

  1. <configuration>
  2. <!-- Site specific YARN configuration properties -->
  3. <property>
  4. <name>yarn.nodemanager.aux-services</name>
  5. <value>mapreduce_shuffle</value>
  6. <description>Yarn Node Manager Aux Service</description>
  7. </property>
  8. </configuration>

5. 格式化目录

创建数据目录

C:\hadoop-3.3.0\data\dfs\namenode

C:\hadoop-3.3.0\data\dfs\datanode

  1. cd C:\hadoop-3.3.0\bin
  2. hdfs namenode -format

注意:-format中开头的短横容易写成全角下的短横,这样会导致错误,一定要用半角短横

 选择Y

6. 验证服务

  1. C:\hadoop-3.3.0\sbin> jps
  2. 17504 NameNode
  3. 17584 Jps
  4. 20944 NodeManager
  5. 3852 DataNode
  6. 4572 ResourceManager
  7. PS C:\hadoop-3.3.0\sbin>

7. 启动

进入C:\hadoop-3.3.0\sbin

执行start-dfs.cmd文件

  1. cd C:\hadoop-3.3.0\sbin
  2. start-dfs.cmd

执行start-yarn.cmd文件

  1. cd C:\hadoop-3.3.0\sbin
  2. start-yarn.cmd

可能问题:

如果出现报错:

 java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/server/timelineservice/collector/TimelineColl

可以复制
C:\hadoop-3.3.0\share\hadoop\yarn\timelineservice\hadoop-yarn-server-timelineservice-3.3.0.jar

C:\hadoop-3.3.0\share\hadoop\yarn

8. Hadoop的WebUI工具

三、参考文章

https://brain-mentors.com/hadoopinstallation/

https://towardsdatascience.com/installing-hadoop-3-2-1-single-node-cluster-on-windows-10-ac258dd48aef

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/473560
推荐阅读
相关标签
  

闽ICP备14008679号