Detailed Hadoop configuration file

Note: I kind of sample code three machines named node1, node2, node3, demonstration code needs to be replaced with your own

1、slaves

node1
node2
node3
hadoop3.0 later changed its name to workers of slaves

2、hadoop-env.sh


# 由于hadoop是基于java语言的程序,所以,需要配置JDK
export JAVA_HOME=/server/jdk1.8.0_171

3、core-site.xml

<configuration>
	<!-- 指定hadoop所使用的文件系统schema,HDFS的大哥(NameNode)的地址 -->
	<property>
		<name>fs.defaultFS</name>
		<value>hdfs://xiaob01:9000</value>
	</property>

	<!--指定hadoop运行时产生文件的存储目录,默认存放在/tmp/hadoop-${user.name}-->
	<property>
		<name>hadoop.tmp.dir</name>
		<value>/home/hadoop/tmp</value>
	</property>
</configuration>

4、hdfs-site.xml

<configuration>
	<!-- 文件备份的数量 -->
	<property>
		<name>dfs.replication</name>
		<value>2</value>
	</property>
	<!-- 指定secondary节点在哪儿 -->
	<property>
		<name>dfs.namenode.secondary.http-address</name>
		<value>node2:50090</value>
	</property>
</configuration>

5、mapred-site.xml

<configuration>
	<!-- 指定mapreduce运行的位置  -->	
	<property>
		<name>mapreduce.framework.name</name>
		<value>yarn</value>
	</property>	
</configuration>

6、yarn-site.xml

<configuration>
<!-- Site specific YARN configuration properties -->
	<!-- 指定yarn的大哥的位置,也就是ResourceManager的位置 -->
	<property>
		<name>yarn.resourcemanager.hostname</name>
		<value>node1</value>
	</property>	
	<!-- NodeManager上运行的附属服务,配置了此项,才能运行MapReduce程序的默认值 -->
	<property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>  
</configuration>

Profiles can not have Chinese, so remember to remove comments

Download the complete configuration file, in addition to the host name you do not need to modify
https://download.csdn.net/download/xiao_xiao_b/11245074

Guess you like

Origin blog.csdn.net/xiao_xiao_b/article/details/92680861