重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

hadoop集群搭建(二)YARN高可用

[root@hadoop01 ~]# vim /usr/local/hadoop-2.7.1/etc/hadoop/yarn-site.xml

在定州等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站制作、网站设计 网站设计制作按需制作,公司网站建设,企业网站建设,高端网站设计,成都全网营销推广,成都外贸网站制作,定州网站建设费用合理。

yarn.nodemanager.aux-services

mapreduce_shuffle

yarn.resourcemanager.ha.enabled

true

yarn.resourcemanager.ha.automatic-failover.enabled

true

yarn.resourcemanager.cluster-id

qianfengyarn

yarn.resourcemanager.ha.rm-ids

rm1,rm2

yarn.resourcemanager.hostname.rm1

hadoop01

yarn.resourcemanager.hostname.rm2

hadoop02

yarn.resourcemanager.webapp.address.rm1

hadoop01:8088

yarn.resourcemanager.webapp.address.rm2

hadoop02:8088

yarn.resourcemanager.zk-address

hadoop01:2181,hadoop02:2181,hadoop03:2181

[root@hadoop01 hadoop-2.7.1]# vim ./etc/hadoop/mapred-site.xml

mapreduce.framework.name

yarn

true

mapreduce.map.memory.mb

1024

mapreduce.jobhistory.address

hadoop01:10020

mapreduce.jobhistory.webapp.address

hadoop01:19888


发送到集群服务器

[root@hadoop01 hadoop-2.7.1]# scp -r ./etc/hadoop/mapred-site.xml hadoop02:/usr/local/hadoop-2.7.1/etc/hadoop/

mapred-site.xml                                                                        100% 1218     1.2KB/s   00:00

[root@hadoop01 hadoop-2.7.1]# scp -r ./etc/hadoop/mapred-site.xml hadoop03:/usr/local/hadoop-2.7.1/etc/hadoop/

mapred-site.xml                                                                        100% 1218     1.2KB/s   00:00

[root@hadoop01 hadoop-2.7.1]# scp -r ./etc/hadoop/yarn-site.xml hadoop03:/usr/local/hadoop-2.7.1/etc/hadoop/

yarn-site.xml                                                                          100% 1845     1.8KB/s   00:00

[root@hadoop01 hadoop-2.7.1]# scp -r ./etc/hadoop/yarn-site.xml hadoop02:/usr/local/hadoop-2.7.1/etc/hadoop/

yarn-site.xml


[root@hadoop01 hadoop-2.7.1]# start-yarn.sh

starting yarn daemons

starting resourcemanager, logging to /usr/local/hadoop-2.7.1/logs/yarn-root-resourcemanager-hadoop01.out

hadoop01: starting nodemanager, logging to /usr/local/hadoop-2.7.1/logs/yarn-root-nodemanager-hadoop01.out

hadoop03: starting nodemanager, logging to /usr/local/hadoop-2.7.1/logs/yarn-root-nodemanager-hadoop03.out

hadoop02: starting nodemanager, logging to /usr/local/hadoop-2.7.1/logs/yarn-root-nodemanager-hadoop02.out

[root@hadoop02 sbin]# yarn-daemon.sh start resourcemanager

starting resourcemanager, logging to /usr/local/hadoop-2.7.1/logs/yarn-root-resourcemanager-hadoop02.out

查看ResourceManager状态

[root@hadoop01 hadoop-2.7.1]# yarn rmadmin -getServiceState rm1

18/01/13 16:17:56 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

active

[root@hadoop02 sbin]# yarn rmadmin -getServiceState rm2

18/01/13 16:20:51 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

standby

[root@hadoop01 ~]# start-all.sh


[root@hadoop01 ~]# service ntpd start


集群所有机器开启zookeeper,zkServer.sh start

[root@hadoop01 ~]# yarn-daemon.sh start resourcemanager

[root@hadoop01 ~]# start-dfs.sh

所有的进程必须都有,请仔细核对

[root@hadoop01 logs]# jps

8608 JobHistoryServer

16833 DataNode

3155 QuorumPeerMain

17300 ResourceManager

17463 Jps

16727 NameNode

17210 DFSZKFailoverController

17423 NodeManager

17055 JournalNode

[root@hadoop02 ~]# jps

9472 DFSZKFailoverController

7108 ResourceManager

9254 DataNode

9719 Jps

9353 JournalNode

9566 NodeManager

9183 NameNode

2751 QuorumPeerMain

[root@hadoop03 ~]# jps

2546 QuorumPeerMain

6738 Jps

6503 JournalNode

6408 DataNode

6606 NodeManager

8608 JobHistoryServer

[root@hadoop01 logs]# mr-jobhistory-daemon.sh stop historyserver

[root@hadoop01 logs]# mr-jobhistory-daemon.sh start historyserver

7108 ResourceManager

[root@hadoop02 ~]# stop-yarn.sh

stopping yarn daemons

stopping resourcemanager

hadoop02: no nodemanager to stop

hadoop01: no nodemanager to stop

hadoop03: no nodemanager to stop

no proxyserver to stop

[root@hadoop02 sbin]# yarn-daemon.sh start resourcemanager

[root@hadoop02 ~]# hadoop-daemon.sh start namenode

starting namenode, logging to /usr/local/hadoop-2.7.1/logs/hadoop-root-namenode-hadoop02.out

测试

hadoop jar /usr/local/hadoop-2.7.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.1.jar wordcount /README.txt /out/05


新闻标题:hadoop集群搭建(二)YARN高可用
文章位置:http://cqcxhl.com/article/ppscee.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP