大数据平台搭建(hadoop+spark) (3)

vim mapred-site.xml

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="http://www.likecs.com/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 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> <!-- 指定mr运行在yarn上 --> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> <!--历史服务的web端口地址 --> <property> <name>mapreduce.jobhistory.webapp.address</name> <value>172.16.200.81:19888</value> </property> <!--历史服务的端口地址--> <property> <name>mapreduce.jobhistory.address</name> <value>172.16.200.81:10020</value> </property> <!--Uber运行模式--> <property> <name>mapreduce.job.ubertask.enable</name> <value>false</value> </property> <!--MapReduce作业产生的日志存放位置。--> <property> <name>mapreduce.jobhistory.intermediate-done-dir</name> <value>${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate</value> </property> <!--MR JobHistory Server管理的日志的存放位置--> <property> <name>mapreduce.jobhistory.done-dir</name> <value>${yarn.app.mapreduce.am.staging-dir}/history/done</value> </property> <!--是job运行时的临时文件夹--> <property> <name>yarn.app.mapreduce.am.staging-dir</name> <value>/data/hadoop/hadoop-yarn/staging</value> </property> </configuration> 1.4.5 配置slaves vim slaves 172.16.200.81 172.16.200.82 172.16.200.83 172.16.200.84 1.4.6 配置yarn vim yarn-site.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 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> <!-- 指定nodeManager组件在哪个机子上跑 --> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <!-- 指定resourcemanager组件在哪个机子上跑 --> <property> <name>yarn.resourcemanager.hostname</name> <value>172.16.200.81</value> </property> <!--resourcemanager web地址--> <property> <name>yarn.resourcemanager.webapp.address</name> <value>172.16.200.81:8088</value> </property> <!--启用日志聚集功能--> <property> <name>yarn.log-aggregation-enable</name> <value>true</value> </property> <!--在HDFS上聚集的日志最多保存多长时间--> <property> <name>yarn.log-aggregation.retain-seconds</name> <value>86400</value> </property> </configuration> 2. 搭建Spark(master、slave相同操作) 2.1 安装spark cd /usr/loca/src/ tar zxvf spark-2.0.2-bin-hadoop2.7.tgz mv spark-2.0.2-bin-hadoop2.7 /usr/local/spark-2.0.2 2.2 配置spark环境变量 vim /etc/profile

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwxgjd.html