Hadoop完全分布式配置问题

关于搭建Hadoop完全分布式时配置的问题

配置hadoop的配置文件core-site.xml, hdfs-site.xml, mapred-site.xml,yarn-site.xml,slaves(workers)(都在Hadoop安装目录/etc/hadoop文件夹下)
1、core-site.xml

<configuration>
  <property>
    <name>fs.default.name</name>
    <value>hdfs://主机的hostname:9000</value>
  </property>
  <property>
    <name>hadoop.tmp.dir</name>
    <value>file:你的Hadoop安装目录/tmp</value>
  </property>
</configuration>

2.hdfs-site.xml

<configuration>
  <property>
    <name>dfs.replication</name>
    <value>2</value>
  </property>
  <property>
    <name>dfs.namenode.name.dir</name>
    <value>file:Hadoop安装目录/dfs/name</value>
  </property>
  <property>
    <name>dfs.datanode.data.dir</name>
    <value>file:Hadoop安装目录/tmp/dfs/data</value>
  </property>
  <property>
    <name>dfs.namenode.secondary.http-address</name>
    <value>主机的hostname:9001</value>
  </property>
</configuration>

3.mapred-site.xml

<configuration>
  <property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
  </property>
</configuration>

4.yarn-site.xml

<configuration>
  <property>
    <name>yarn.resourcemanager.hostname</name>
    <value>主机的hostname</value>
  </property>
  <property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
  </property>
  <property>
    <name>yarn.log-aggregation-enable</name>
    <value>true</value>
  </property>
  <property>
    <name>yarn.log-aggregation.retain-seconds</name>
    <value>604800</value>
  </property>
  <property>
    <name>yarn.application.classpath</name>
    <value>在终端输入hadoop classpath获取的值</value>
  </property>
</configuration>

5.slaves(在Hadoop3.x是workers)

slave1
slave2
这里是你的从节点的hostname

猜你喜欢

转载自blog.csdn.net/qq_40663357/article/details/83142851
今日推荐