Hadoop3-分布式模式安装

2018-02-24  本文已影响39人  kongxx

接前一篇博客,这次做安装一个真正的分布式集群环境。

准备

配置

修改下面几个配置文件

etc/hadoop/core-site.xml

<configuration>
  <property>
    <name>fs.defaultFS</name>
    <value>hdfs://bd1:9000</value>
  </property>
</configuration>

etc/hadoop/hdfs-site.xml

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>3</value>
  </property>
</configuration>

etc/hadoop/mapred-site.xml

<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
    <property>
        <name>yarn.app.mapreduce.am.env</name>
        <value>HADOOP_MAPRED_HOME=/apps/hadoop-3.0.0</value>
    </property>
    <property>
        <name>mapreduce.map.env</name>
        <value>HADOOP_MAPRED_HOME=/apps/hadoop-3.0.0</value>
    </property>
    <property>
        <name>mapreduce.reduce.env</name>
        <value>HADOOP_MAPRED_HOME=/apps/hadoop-3.0.0</value>
    </property>
</configuration>

etc/hadoop/yarn-site.xml

<configuration>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>
        <name>yarn.nodemanager.vmem-check-enabled</name>
        <value>false</value>
    </property>
    <property>
        <name>yarn.nodemanager.vmem-pmem-ratio</name>
        <value>4</value>
    </property>
</configuration>

etc/hadoop/workers

bd1
bd2
bd3

运行 HDFS 和 yarn

格式化 HDFS

$ bin/hdfs namenode -format

启动集群

$ sbin/start-dfs.sh
$ sbin/start-yarn.sh

运行 MapReduce 作业

停止集群

$ sbin/stop-yarn.sh
$ sbin/stop-dfs.sh
上一篇下一篇

猜你喜欢

热点阅读