Xml代码
- <configuration>
- <property>
- <name>fs.default.name</name>
- <value>hdfs://ns1</value>
- </property>
- <property>
- <name>hadoop.tmp.dir</name>
- <value>/ROOT/server/data-hadoop/hadooptmp</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.co
- mpress.SnappyCodec</value>
- </property>
- <property>
- <name>fs.trash.interval</name>
- <value>0</value>
- <description>Number of minutes between trash checkpoints.
- If zero, the trash feature is disabled.
- </description>
- </property>
- <!-- ha的zk的配置 -->
- <property>
- <name>ha.zookeeper.quorum</name>
- <value>h1:2181,h2:2181,h3:2181</value>
- </property>
- </configuration>
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>1</value>
- </property>
- <!-- 集群数量小于3时,副本数大于1时,建议启用 -->
- <!-- <property>
- <name>dfs.client.block.write.replace-datanode-on-failure.enable</name>
- <value>false</value>
- </property>
- -->
- <property>
- <name>dfs.namenode.name.dir</name>
- <value>file:///ROOT/server/data-hadoop/nd</value>
- </property>
- <property>
- <name>dfs.datanode.data.dir</name>
- <value>/ROOT/server/data-hadoop/dd</value>
- </property>
- <property>
- <name>dfs.permissions</name>
- <value>false</value>
- </property>
- <property>
- <name>dfs.nameservices</name>
- <value>ns1</value>
- </property>
- <property>
- <name>dfs.ha.namenodes.ns1</name>
- <value>h1,h2</value>
- </property>
- <property>
- <name>dfs.namenode.rpc-address.ns1.h1</name>
- <value>h1:9000</value>
- </property>
- <property>
- <name>dfs.namenode.http-address.ns1.h1</name>
- <value>h1:50070</value>
- </property>
- <property>
- <name>dfs.namenode.rpc-address.ns1.h2</name>
- <value>h2:9000</value>
- </property>
- <property>
- <name>dfs.namenode.http-address.ns1.h2</name>
- <value>h2:50070</value>
- </property>
- <property>
- <name>dfs.namenode.shared.edits.dir</name>
- <value>qjournal://h1:8485;h2:8485;h3:8485/ns1</value>
- </property>
- <property>
- <name>dfs.ha.automatic-failover.enabled.ns1</name>
- <value>true</value>
- </property>
- <property>
- <name>dfs.client.failover.proxy.provider.ns1</name>
- <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
- </property>
- <property>
- <name>dfs.journalnode.edits.dir</name>
- <value>/ROOT/server/data-hadoop/journaldata</value>
- </property>
- <property>
- <name>dfs.ha.fencing.methods</name>
- <value>sshfence</value>
- </property>
- <property>
- <name>dfs.ha.fencing.ssh.private-key-files</name>
- <value>/home/webmaster/.ssh/id_rsa</value>
- </property>
- <property>
- <name>dfs.webhdfs.enabled</name>
- <value>true</value>
- </property>
- <property>
- <name>dfs.blocksize</name>
- <value>134217728</value>
- </property>
- <property>
- <name>dfs.namenode.handler.count</name>
- <value>20</value>
- </property>
- <property>
- <name>dfs.datanode.max.xcievers</name>
- <value>2048</value>
- </property>
- </configuration>
Xml代码
- <?xml version="1.0"?>
- <!--
- 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.
- -->
- <configuration>
- <!--启用RM高可用-->
- <property>
- <name>yarn.resourcemanager.ha.enabled</name>
- <value>true</value>
- </property>
- <!--RM集群标识符-->
- <property>
- <name>yarn.resourcemanager.cluster-id</name>
- <value>ns1</value>
- </property>
- <property>
- <!--指定两台RM主机名标识符-->
- <name>yarn.resourcemanager.ha.rm-ids</name>
- <value>h1,h2</value>
- </property>
- <!--RM故障自动切换-->
- <property>
- <name>yarn.resourcemanager.ha.automatic-failover.recover.enabled</name>
- <value>true</value>
- </property>
- <!--RM故障自动恢复-->
- <property>
- <name>yarn.resourcemanager.recovery.enabled</name>
- <value>true</value>
- </property>
- <!--RM主机1-->
- <property>
- <name>yarn.resourcemanager.hostname.h1</name>
- <value>h1</value>
- </property>
- <!--RM主机2-->
- <property>
- <name>yarn.resourcemanager.hostname.h2</name>
- <value>h2</value>
- </property>
- <!--RM状态信息存储方式,一种基于内存(MemStore),另一种基于ZK(ZKStore)-->
- <property>
- <name>yarn.resourcemanager.store.class</name>
- <value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value>
- </property>
- <!--使用ZK集群保存状态信息-->
- <property>
- <name>yarn.resourcemanager.zk-address</name>
- <value>h1:2181,h2:2181,h3:2181</value>
- </property>
- <!--向RM调度资源地址-->
- <property>
- <name>yarn.resourcemanager.scheduler.address.h1</name>
- <value>h1:8030</value>
- </property>
- <property>
- <name>yarn.resourcemanager.scheduler.address.h2</name>
- <value>h2:8030</value>
- </property>
- <!--NodeManager通过该地址交换信息-->
- <property>
- <name>yarn.resourcemanager.resource-tracker.address.h1</name>
- <value>h1:8031</value>
- </property>
- <property>
- <name>yarn.resourcemanager.resource-tracker.address.h2</name>
- <value>h2:8031</value>
- </property>
- <!--客户端通过该地址向RM提交对应用程序操作-->
- <property>
- <name>yarn.resourcemanager.address.h1</name>
- <value>h1:8032</value>
- </property>
- <property>
- <name>yarn.resourcemanager.address.h2</name>
- <value>h2:8032</value>
- </property>
- <!--管理员通过该地址向RM发送管理命令-->
- <property>
- <name>yarn.resourcemanager.admin.address.h1</name>
- <value>h1:8033</value>
- </property>
- <property>
- <name>yarn.resourcemanager.admin.address.h2</name>
- <value>h2:8033</value>
- </property>
- <!--RM HTTP访问地址,查看集群信息-->
- <property>
- <name>yarn.resourcemanager.webapp.address.h1</name>
- <value>h1:8088</value>
- </property>
- <property>
- <name>yarn.resourcemanager.webapp.address.h2</name>
- <value>h2:8088</value>
- </property>
- <property>
- <name>yarn.resourcemanager.scheduler.class</name>
- <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler</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>
- <description>Classpath for typical applications.</description>
- <name>yarn.application.classpath</name>
- <value>$HADOOP_CONF_DIR
- ,$HADOOP_COMMON_HOME/share/hadoop/common/*
- ,$HADOOP_COMMON_HOME/share/hadoop/common/lib/*
- ,$HADOOP_HDFS_HOME/share/hadoop/hdfs/*
- ,$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*
- ,$YARN_HOME/share/hadoop/yarn/*</value>
- </property>
- <!-- Configurations for NodeManager -->
- <property>
- <name>yarn.nodemanager.resource.memory-mb</name>
- <value>5632</value>
- </property>
- <property>
- <name>yarn.scheduler.minimum-allocation-mb</name>
- <value>1408</value>
- </property>
- <property>
- <name>yarn.scheduler.maximum-allocation-mb</name>
- <value>5632</value>
- </property>
- </configuration>
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>
- </property>
- <property>
- <name>mapreduce.jobtracker.address</name>
- <value>h1:8021</value>
- </property>
- <property>
- <name>mapreduce.jobhistory.address</name>
- <value>h1:10020</value>
- </property>
- <property>
- <name>mapreduce.jobhistory.webapp.address</name>
- <value>h1:19888</value>
- </property>
- <property>
- <name>mapred.max.maps.per.node</name>
- <value>2</value>
- </property>
- <property>
- <name>mapred.max.reduces.per.node</name>
- <value>1</value>
- </property>
- <property>
- <name>mapreduce.map.memory.mb</name>
- <value>1408</value>
- </property>
- <property>
- <name>mapreduce.map.java.opts</name>
- <value>-Xmx1126M</value>
- </property>
- <property>
- <name>mapreduce.reduce.memory.mb</name>
- <value>2816</value>
- </property>
- <property>
- <name>mapreduce.reduce.java.opts</name>
- <value>-Xmx2252M</value>
- </property>
- <property>
- <name>mapreduce.task.io.sort.mb</name>
- <value>512</value>
- </property>
- <property>
- <name>mapreduce.task.io.sort.factor</name>
- <value>100</value>
- </property>
- </configuration>