hadoop xml配置详解

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq262593421/article/details/102134668

目录

1、core-size.xml

2、hdfs-site.xml

3、mapred-site.xml

4、yarn-site.xml


hadoop的常用配置文件,不需要记,知道哪个配置有什么作用就行了,下次配置的时候可以直接拿来用。

1、core-size.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
	<!--主要的-->
	<property>
		<name>io.native.lib.available</name>
		<value>true</value>
		<description>开启本地库支持</description>
	</property>
	
	<!--主要的-->
	<property>
		<name>fs.defaultFS</name>
		<value>hdfs://ns1</value>
		<description>默认文件服务的协议和NS逻辑名称,和hdfs-site里的对应此配置替代了1.0里的fs.default.name</description>
	</property>
	
	<property>
		<name>hadoop.tmp.dir</name>
		<value>/data/tmp</value>
	</property>
	
	<!--主要的-->
	<property>
		<name>io.compression.codecs</name>
		<value>org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.BZip2Codec,org.apache.hadoop.io.compress.SnappyCodec</value>
		<description>相应编码的操作类</description>
	</property>
	
	<property>
		<name>io.file.buffer.size</name>
		<value>131072</value>
		<description>SequenceFiles在读写中可以使用的缓存大小</description>
	</property>
	
	<!--主要的-->
	<property>
		<name>ha.zookeeper.quorum</name>
		<value>nn1.hadoop:2181,nn2.hadoop:2181,s1.hadoop:2181</value>
		<description>HA使用的zookeeper地址</description>
	</property>
	
	
	
	<property>
		<name>ipc.client.connection.maxidletime</name>
		<value>60000</value>
	</property>
	<property>
		<name>mapreduce.output.fileoutputformat.compress.type</name>
		<value>BLOCK</value>
	</property>
	<property>
		<name>io.seqfile.compressioin.type</name>
		<value>BLOCK</value>
	</property>
	<property>
		<name>hadoop.proxyuser.root.groups</name>
		<value>hadoop</value>
		<description>hdfs dfsadmin –refreshSuperUserGroupsConfiguration,yarn rmadmin –refreshSuperUserGroupsConfiguration使用这两个命令不用重启就能刷新</description>
	</property>
	<property>
		<name>hadoop.proxyuser.root.hosts</name>
		<value>localhost</value>
	</property>	
</configuration>

2、hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
	<property>
		<name>dfs.replication</name>
		<value>1</value>
	</property>
	<property>
		<name>fs.trash.interval</name>
		<value>2880</value>
		<description>回收周期</description>
	</property>
	<property>
		<name>dfs.blocksize</name>
		<value>67108864</value>
		<description>文件块的大小</description>
	</property>
</configuration>

3、mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
        <description>运行模式</description>
    </property>
</configuration>

4、yarn-site.xml

<?xml version="1.0"?>
<configuration>
	<property>
		<name>yarn.nodemanager.aux-services</name>
		<value>mapreduce_shuffle</value>
		<description>NodeManager上运行的附属服务。需配置成mapreduce_shuffle,才可运行MapReduce程序</description>
	</property>	

	<property>
		<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
		<value>org.apache.hadoop.mapred.ShuffleHandler</value>
	</property>
	
	<property>
		<name>yarn.resourcemanager.hostname</name>
		<value>localhost</value>
	</property>	
</configuration>


 

猜你喜欢

转载自blog.csdn.net/qq262593421/article/details/102134668