Windows Hadoop新手安装五部曲

image.png

0x01 下载:

hadoop和对应版本编译好的bin文件:
https://github.com/cdarlint/winutils
https://archive.apache.org/dist/hadoop/common/hadoop-2.9.0/hadoop-2.9.0.tar.gz
解压hadoop-2.9.0.tar.gz后,将编译的好的bin文件夹替换掉原始的bin文件夹:

image.png

0x02 修改:

配置文件:

  • hadoop-2.9.0/etc/hadoop/hadoop-env.cmd
    JAVA_HOME设置为本机上jdk的路径,Program file目录对应的是PROGRA~1
    set JAVA_HOME=C:\PROGRA~1\Java\jdk-1.8.0


    image.png
  • hadoop-2.9.0/etc/hadoop/core-site.xml

  
      fs.defaultFS
      hdfs://localhost:9000
  

  • hadoop-2.9.0/etc/hadoop/mapred-site.xml

   
       mapreduce.framework.name
       yarn
   

  • hadoop-2.9.0/etc/hadoop/hdfs-site.xml


       dfs.replication
       1
   
   
       dfs.namenode.name.dir
       /C:/env/hadoop-2.9.0/data/namenode
   
   
       dfs.datanode.data.dir
     /C:/env/hadoop-2.9.0/data/datanode
   

  • hadoop-2.9.0/etc/hadoop/yarn-site.xml

   
       yarn.nodemanager.aux-services
       mapreduce_shuffle
   
   
       yarn.nodemanager.aux-services.mapreduce.shuffle.class
       org.apache.hadoop.mapred.ShuffleHandler
   

0x03 启动

  • 在bin目录下输入hadoop namenode -format,格式化namenode:


    image.png
  • 在sbin目录下输入start-all,启动hadoop:


    image.png
  • 输入jps,看到如下结果,启动成功:


    image.png

0x04 访问:

  • http://localhost:50070/
    image.png
  • http://localhost:8088/cluster
    image.png

0x05 停止:

  • 在sbin目录下输入stop-all


    s

0x06 参考:

https://www.jianshu.com/p/faf038923093
https://dimensionless.in/know-how-to-install-and-run-hadoop-on-windows-for-beginners/

你可能感兴趣的:(Windows Hadoop新手安装五部曲)