# The java implementation to use.exportJAVA_HOME=/export/server/jdk1.8.0_171/
# The jsvc implementation to use. Jsvc is required to run secure datanodes# that bind to privileged ports to provide authentication of data transfer# protocol. Jsvc is not required if SASL is configured for authentication of# data transfer protocol using non-privileged ports.#export JSVC_HOME=${JSVC_HOME}#export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"}exportHADOOP_CONF_DIR=/export/server/hadoop-2.7.3/etc/hadoop
hdfs-site.xml
[root@mast hadoop]# vim hdfs-site.xml <?xml version="1.0"encoding="UTF-8"?><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><!--
Licensed under the Apache License, Version 2.0(the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--><!-- Put site-specific property overrides in this file. --><configuration><property><name>dfs.replication</name><value>2</value><description>datenode数,默认是3,应小于datanode机器数量</description></property><property><name>dfs.namenode.name.dir</name><value>file:/export/server/hadoop-2.7.3/hdfs/name</value><description>namenode上存储hdfs名字空间元数据</description></property><property><name>dfs.datanode.data.dir</name><value>file:/export/server/hadoop-2.7.3/hdfs/data</value><description>datanode上数据块的物理存储位置</description></property></configuration>
core-site.xml
[root@mast hadoop]# cat core-site.xml <?xml version="1.0"encoding="UTF-8"?><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><!--
Licensed under the Apache License, Version 2.0(the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--><!-- Put site-specific property overrides in this file. --><configuration><property><name>fs.default.name</name><value>hdfs://mast:9000</value><description>指定HDFS的默认名称</description></property><property><name>fs.defaultFS</name><value>hdfs://mast:9000</value><description>HDFS的URL</description></property><property><name>hadoop.tmp.dir</name><value>/export/server/hadoop-2.7.3/tmp</value><description>节点上本地的hadoop临时文件夹</description></property></configuration>
mapper-site.xml
[root@mast hadoop]# cat mapred-site.xml<?xml version="1.0"?><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><!--
Licensed under the Apache License, Version 2.0(the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--><!-- Put site-specific property overrides in this file. --><configuration><property><name>mapreduce.framework.name</name><value>yarn</value><description>指定mapreduce使用yarn框架</description></property><!-- 历史服务器端地址 --><property><name>mapreduce.jobhistory.address</name><value>mast:10020</value></property><!-- 历史服务器Web端地址 --><property><name>mapreduce.jobhistory.webapp.address</name><value>mast:19888</value></property></configuration>