• Hadoop2.8 安装


    一、下载Hadoop与java

    jdk-8u221-linux-x64.tar.gz  Oracle官网下载

    hadoop-2.8.5.tar.gz   Hadoop官网下载

    二、配置服务期间ssh免密互通

    使用如下互信安装脚本

    https://www.cnblogs.com/xibuhaohao/p/11772047.html

    三、配置服务期间时钟同步服务

    四、解压安装Hadoop文件与Java

    1、解压缩(每个结点都要做)

    1)安装Java

    2)安装Hadoop

    新建Hadoop用户

    2、配置结点环境变量

    cat .bash_profile

    添加如下:

    export JAVA_HOME=/usr/java/jdk1.8.0_221
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$JAVA_HOME/jre/bin:$PATH
    export HADOOP_HOME=/home/hadoop/hadoop-2.8.5
    export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

    五、修改配置文件

    cd /home/hadoop/hadoop-2.8.5/etc/hadoop

    1、core-site.xml

    <configuration>
    <!--配置hdfs文件系统的命名空间-->
      <property>
        <name>fs.defaultFS</name>
        <value>hdfs://data0:9000</value>
      </property>
    <!-- 配置操作hdfs的存冲大小 -->
      <property>
        <name>io.file.buffer.size</name>
        <value>4096</value>
      </property>
    <!-- 配置临时数据存储目录 -->
      <property>
        <name>hadoop.tmp.dir</name>
        <value>/home/hadoop/hadoop-2.8.5/tmp</value>
      </property>
    </configuration>

    2、hdfs-site.xml

    <!--配置副本数-->
      <property>
        <name>dfs.replication</name>
          <value>3</value>
            </property>
            <!--hdfs的元数据存储位置-->
      <property>
        <name>dfs.namenode.name.dir</name>
          <value>/home/hadoop/hadoop-2.8.5/hdfs/name</value>
           </property>
           <!--hdfs的数据存储位置-->
     <property>
       <name>dfs.datanode.data.dir</name>
         <value>/home/hadoop/hadoop-2.8.5/hdfs/data</value>
          </property>
          <!--hdfs的namenode的web ui 地址-->
     <property>
       <name>dfs.http.address</name>
        <value>data0:50070</value>
          </property>
          <!--hdfs的snn的web ui 地址-->
      <!-- <property>
       <name>dfs.secondary.http.address</name>
         <value>data0:50090</value>
           </property>
    -->
           <!--是否开启web操作hdfs-->
     <property>
       <name>dfs.webhdfs.enabled</name>
        <value>true</value>
          </property>
          <!--是否启用hdfs权限(acl)-->
      <property>
        <name>dfs.permissions</name>
          <value>false</value>
            </property>
    </configuration>

    3、mapred-site.xml

    <configuration>
    <!--指定maoreduce运行框架-->
            <property>
                            <name>mapreduce.framework.name</name>
                                            <value>yarn</value> </property>
                                            <!--历史服务的通信地址-->
            <property>
                            <name>mapreduce.jobhistory.address</name>
                                            <value>data0:10020</value>
                                                    </property>
                                                    <!--历史服务的web ui地址-->
            <property>
                            <name>mapreduce.jobhistory.webapp.address</name>
                                            <value>data0:19888</value>
                                                    </property>
    </configuration>

    4、yarn-site.xml

    <configuration>
    <!-- Site specific YARN configuration properties -->

    <!--指定resourcemanager所启动的服务器主机名-->
            <property>
                            <name>yarn.resourcemanager.hostname</name>
                                            <value>data0</value>
                                                    </property>
                                                    <!--指定mapreduce的shuffle-->
            <property>
                            <name>yarn.nodemanager.aux-services</name>
                                            <value>mapreduce_shuffle</value>
                                                    </property>
                                                    <!--指定resourcemanager的内部通讯地址-->
            <property>
                            <name>yarn.resourcemanager.address</name>
                                            <value>data0:8032</value>
                                                    </property>
                                                    <!--指定scheduler的内部通讯地址-->
            <property>
                            <name>yarn.resourcemanager.scheduler.address</name>
                                            <value>data0:8030</value>
                                                    </property>
                                                    <!--指定resource-tracker的内部通讯地址-->
            <property>
                            <name>yarn.resourcemanager.resource-tracker.address</name>
                                            <value>data0:8031</value>
                                                    </property>
                                                    <!--指定resourcemanager.admin的内部通讯地址-->
            <property>
                            <name>yarn.resourcemanager.admin.address</name>
                                            <value>data0:8033</value>
                                                    </property>
                                                    <!--指定resourcemanager.webapp的ui监控地址-->
            <property>
                            <name>yarn.resourcemanager.webapp.address</name>
                                            <value>data0:8088</value>
                                                    </property>
    </configuration>

    六、启动Hadoop

    1、初始化Namenode

     hadoop namenode -format

    2、开启namenode

    ./sbin/hadoop-daemon.sh start namenode
    开启后使用jps验证
     
     

    3、启动集群

    ./sbin/start-all.sh

    4、查看集群个资源是否启动

    jps
    1)namenode

    2)datanode1

    3)datanode2

     七、网页登录

     1、namenode

    data0:50070

     2、Hadoop

    data0:8088

  • 相关阅读:
    E小press框架之第三步(参数接收)
    Express框架之第二步(路由)
    Express框架之第一步(创建工程)
    【排序】基数排序
    【数学】平方和公式$$sum_{i=1}^{n}i^2=frac{n(n+1)(2n+1)}{6}$$
    【博弈论】Nim游戏
    【搜索】对抗搜索【CF】J. Situation
    【图论】Kruskal算法
    dijkstra算法+堆优化 + 链式前向星版本
    【DP】【数位DP】
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/11772031.html
Copyright © 2020-2023  润新知