Browse Source

新增对yarn的支持

master
louzin 2 years ago
parent
commit
3afb057133
  1. 2
      centos_standalone_hbase.sh
  2. 25
      hadoop/mapred-site.xml
  3. 28
      hadoop/yarn-site.xml
  4. 2
      ubuntu_standalone_hbase.sh

2
centos_standalone_hbase.sh

@ -40,6 +40,8 @@ echo "开始安装hadoop"
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/slaves
sed "s|\${JAVA_HOME}|$JAVA_HOME|g" -i ./hadoop/hadoop-env.sh
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/core-site.xml
# Hadoop yarn
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/yarn-site
\cp -rf ./hadoop /opt/hadoop-2.9.0/etc/
hdfs namenode -format
echo "开始安装zookeeper"

25
hadoop/mapred-site.xml

@ -0,0 +1,25 @@
<?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>
<!-- 指定MapReduce运行是框架,这里指定在yarn上,默认是local -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>

28
hadoop/yarn-site.xml

@ -0,0 +1,28 @@
<?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>
<!-- Site specific YARN configuration properties -->
<!-- 指定yarn的ResourceManager的地址 -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>{host}</value>
</property>
<!-- NodeManager上运行的附属服务。需要配置成mapreduce_shuffle,才可以运行MapReduce程序默认值 -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>

2
ubuntu_standalone_hbase.sh

@ -40,6 +40,8 @@ echo "开始安装hadoop"
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/slaves
sed "s|\${JAVA_HOME}|$JAVA_HOME|g" -i ./hadoop/hadoop-env.sh
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/core-site.xml
# Hadoop yarn
sed "s/{host}/$(cat /etc/hostname)/g" -i ./hadoop/yarn-site
\cp -rf ./hadoop /opt/hadoop-2.9.0/etc/
hdfs namenode -format
echo "开始安装zookeeper"

Loading…
Cancel
Save