Hadoop完全分布式集群配置文件

本文代码出自《Hadoop大数据开发基础》第二章,把几个修改量大的文件代码给贴出来,便于给同样使用这本书的人复制,因为纯手敲很累还容易出错。

1.修改core-site.xml

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://master:8020</value>
    </property>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>/var/log/hadoop/tmp</value>
    </property>
</configuration>

2.修改mapred-site.xml

<configuration>
    <property>
       <name>mapreduce.framework.name</name>
       <value>yarn</value>
    </property>
    <property>
       <name>mapreduce.jobhistory.address</name>
       <value>master:10020</value>
    </property>
    <property>
       <name>mapreduce.jobhistory.webapp.address</name>
       <value>master:19888</value>
    </property>
</configuration>

3.修改yarn-site.xml

<configuration>

<!-- Site specific YARN configuration properties -->
    <property>
       <name>yarn.resourcemanager.hostname</name>
       <value>master</value>
    </property>
    <property>
       <name>yarn.resourcemanager.address</name>
       <value>${yarn.resourcemanager.hostname}:8032</value>
    </property>
    <property>
       <name>yarn.resourcemanager.scheduler.address</name>
       <value>${yarn.resourcemanager.hostname}:8030</value>
    </property>
    <property>
       <name>yarn.resourcemanager.webapp.address</name>
       <value>${yarn.resourcemanager.hostname}:8088</value>
    </property>
    <property>
       <name>yarn.resourcemanager.webapp.https.address</name>
       <value>${yarn.resourcemanager.hostname}:8090</value>
    </property>
	<property>
       <name>yarn.resourcemanager.resource-tracker.address</name>
       <value>${yarn.resourcemanager.hostname}:8031</value>
    </property>
    <property>
       <name>yarn.resourcemanager.admin.address</name>
       <value>${yarn.resourcemanager.hostname}:8033</value>
    </property>
    <property>
       <name>yarn.nodemanager.local-dirs</name>
       <value>/data/hadoop/yarn/local</value>
    </property>
    <property>
       <name>yarn.log-aggregation-enable</name>
       <value>true</value>
    </property>
    <property>
       <name>yarn.nodemanager.remote-app-log-dir</name>
       <value>/data/tmp/logs</value>
    </property>
    <property>
       <name>yarn.log.server.url</name>
       <value>http://master:19888/jobhistory/logs/</value>
       <description>URL for job history server</description>
    </property>
    <property>
       <name>yarn.nodemanager.vmem-check-enabled</name>
       <value>false</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.nodemanager.resource.memory-mb</name>
       <value>2048</value>
    </property>
    <property>
       <name>yarn.scheduler.minimum-allocation-mb</name>
       <value>512</value>
    </property>
    <property>
       <name>yarn.scheduler.maximum-allocation-mb</name>
       <value>4096</value>
    </property>
    <property>
       <name>mapreduce.map.memory.mb</name>
       <value>2048</value>
    </property>
    <property>
       <name>yarn.nodemanager.resource.cpu-vcores</name>
       <value>1</value>
    </property>

</configuration>

你可能感兴趣的:(大数据)