美文网首页
Hadoop安装教程

Hadoop安装教程

作者: 一只特立独行的猪1991 | 来源:发表于2020-03-28 17:36 被阅读0次
  1. 下载hadoop-2.6.5.tar.gz

  2. 解压

    • 目录:D:\software\hadoop-2.6.5
  3. 配置环境变量

    • 新建变量HADOOP_HOME:D:\software\hadoop-2.6.5
    • 配置PATH:%HADOOP_HOME%\bin

    说明:IDEA需要重启电脑才能识别新增的环境变量

  4. 下载Windows工具类winutils,拷贝到%HADOOP_HOME%\bin文件夹,将其中的hadoop.dll拷贝一份到C:\Windows\System32

  5. 在cmd输入hadoop version,有提示则说明安装成功

  6. 配置Hadoop配置文件

    %HADOOP_HOME%\etc\hadoop\hadoop-env.cmd

    set JAVA_HOME=D:\software\Java\jdk1.8
    set HADOOP_IDENT_STRING=%WS%
    set HADOOP_PREFIX=d:\software\hadoop-2.6.5
    set HADOOP_CONF_DIR=%HADOOP_PREFIX%\etc\hadoop
    set YARN_CONF_DIR=%HADOOP_CONF_DIR%
    set PATH=%PATH%;%HADOOP_PREFIX%\bin
    

    %HADOOP_HOME%\etc\hadoop\core-site.xml

    <configuration>
        <property>
            <name>fs.defaultFS</name>
            <value>hdfs://localhost:9000</value>
            <description>
                默认的HDFS端口,用于NameNode与DataNode之间到的通讯,IP为NameNode的地址
            </description>
        </property>
    </configuration>
    

    %HADOOP_HOME%\etc\hadoop\hdfs-site.xml

    <configuration>
        <property>
            <name>dfs.replication</name>
            <value>1</value>
        </property>
     <property>
         <name>dfs.permissions</name>
         <value>false</value>
     </property>
        <property>
            <name>dfs.namenode.name.dir</name>
            <value>file:///D:/software/hadoop-2.6.5/data/namenode</value>
        </property>
        <property>
            <name>dfs.datanode.data.dir</name>
            <value>file:///D:/software/hadoop-2.6.5/data/datanode</value>
        </property>
    </configuration>
    

    %HADOOP_HOME%\etc\hadoop\mapred-site.xml

    <configuration>
     <property>
         <name>mapreduce.job.user.name</name>
         <value>%WS%</value>
     </property>
     <property>
         <name>mapreduce.framework.name</name>
         <value>yarn</value>
     </property>
     <property>
         <name>yarn.apps.stagingDir</name>
         <value>/user/%WS%/staging</value>
     </property>
     <property>
         <name>mapreduce.jobtracker.address</name>
         <value>local</value>
     </property>
    
    </configuration>
    

    %HADOOP_HOME%\etc\hadoop\yarn-site.xml

    <configuration>
        <property>
            <name>yarn.server.resourcemanager.address</name>
            <value>0.0.0.0:8020</value>
        </property>
        <property>
            <name>yarn.server.resourcemanager.application.expiry.interval</name>
            <value>60000</value>
        </property>
        <property>
            <name>yarn.server.nodemanager.address</name>
            <value>0.0.0.0:45454</value>
        </property>
        <property>
            <name>yarn.nodemanager.aux-services</name>
            <value>mapreduce_shuffle</value>
        </property>
        <property>
            <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
            <value>org.apache.hadoop.mapred.ShuffleHandler</value>
        </property>
        <property>
            <name>yarn.server.nodemanager.remote-app-log-dir</name>
            <value>/app-logs</value>
        </property>
        <property>
            <name>yarn.nodemanager.log-dirs</name>
            <value>/dep/logs/userlogs</value>
        </property>
        <property>
            <name>yarn.server.mapreduce-appmanager.attempt-listener.bindAddress</name>
            <value>0.0.0.0</value>
        </property>
        <property>
            <name>yarn.server.mapreduce-appmanager.client-service.bindAddress</name>
            <value>0.0.0.0</value>
        </property>
        <property>
            <name>yarn.log-aggregation-enable</name>
            <value>true</value>
        </property>
        <property>
            <name>yarn.log-aggregation.retain-seconds</name>
            <value>-1</value>
        </property>
        <property>
            <name>yarn.application.classpath</name>
            <value> %HADOOP_CONF_DIR%,%HADOOP_COMMON_HOME%/share/hadoop/common/*,%HADOOP_COMMON_HOME%/share/hadoop/common/lib/*,%HADOOP_HDFS_HOME%/share/hadoop/hdfs/*,%HADOOP_HDFS_HOME%/share/hadoop/hdfs/lib/*,%HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/*,%HADOOP_MAPRED_HOME%/share/hadoop/mapreduce/lib/*,%HADOOP_YARN_HOME%/share/hadoop/yarn/*,%HADOOP_YARN_HOME%/share/hadoop/yarn/lib/*
            </value>
        </property>
    </configuration>
    

    Windows配置参考:https://cwiki.apache.org/confluence/display/HADOOP2/Hadoop2OnWindows

  7. 启动Hadoop

    • 跳转到Hadoop主目录:cd /d D:software\hadoop-2.6.5

    • 格式化HDFS文件系统:bin\hdfs namenode -format

    • 启动HDFS守护进程:sbin\start-dfs.cmd

    • 上传文件验证:bin\hdfs dfs -put README.txt /

    • 运行:sbin\start-all.cmd

  8. 验证

    说明:jps查看进程不显示,查看C:\Users%USER%\AppData\Local\Temp\hsperfdata_%USER%属性 --> 安全,添加当前账号即可

    参考资料

相关文章

  • Hive 基础搭建教程

    需要安装Hadoop,教程:Hadoop 基础搭建教程 需要了解Hive基本概念:Hive 基础知识 1. 相关依...

  • 基于YARN的HADOOP分布式集群安装

    HADOOP分布式集群安装 前提 SSH,安装教程JAVA,安装教程 准备工作 修改HOSTS,在文件尾加入IP及...

  • Hadoop 安装注意事项

    开源 hadoop 安装 参考教材 Hadoop安装教程有很多,因此不再赘述,下面给出一些比较好的参考: http...

  • 1.搭建Hadoop之HDFS遇到JAVA_HOME问题

    hadoop版本:2.7.7 很多人按照网上的各类教程搭建hadoop,但经常在安装好了后,启动hadoop时出现...

  • Hadoop安装

    官方教程:http://hadoop.apache.org/docs/r2.7.3/ 1.Hadoop安装的三种模...

  • Hadoop安装攻略

    1.Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04http://dbla...

  • Hadoop安装教程

    下载hadoop-2.6.5.tar.gz 解压目录:D:\software\hadoop-2.6.5 配置环境变...

  • 立flag

    最近被Hadoop安装虐的体无完肤,立下此flag,安装好之后写一篇教程!

  • Linux上面安装hadoop3.2.0教程

    Contents Linux上面安装hadoop3.2.0教程一、安装java并配置环境变量1.安装 Java2...

  • CENTOS 8 安装HADOOP

    CENTOS 8 安装HADOOP 1.安装环境 本教程使用 CentOS 8 64位 作为系统环境,请自行安装系...

网友评论

      本文标题:Hadoop安装教程

      本文链接:https://www.haomeiwen.com/subject/owjsuhtx.html