search
HomeDatabaseMysql TutorialResource Manager HA配置详解

Resource Manager HA配置详解

Jun 07, 2016 pm 04:39 PM
managerresourceyarnDetailed explanationConfiguration

YARN中的资源管理器(Resource Manager)负责整个系统的资源管理和调度,并内部维护了各个应用程序的ApplictionMaster信息,NodeManager信息,资源使用信息等。在2.4版本之后,Hadoop Common同样提供了HA的功能,解决了这样一个基础服务的可靠性和容错性问题

YARN中的资源管理器(Resource Manager)负责整个系统的资源管理和调度,并内部维护了各个应用程序的ApplictionMaster信息,NodeManager信息,资源使用信息等。在2.4版本之后,Hadoop Common同样提供了HA的功能,解决了这样一个基础服务的可靠性和容错性问题。其架构如下:
rm-ha-overview
Overview of ResourceManager High Availability
RM HA与NN HA有诸多相同之处(NameNode HA配置详解 ):
(1). Active/Standby架构,同一时间只有一个RM处于活动状态(如上图所示)。
(2). 依赖zooKeeper实现。手动切换使用yarn rmadmin命令(类似hdfs haadmin命令),而自动故障转移使用ZKFailoverController。但不同的是,zkfc只作为RM中一个线程而非独立的守护进程来启动。
(3). 当存在多个RM时,客户端使用的yarn-site.xml需要指定RM的列表。 客户端, ApplicationMasters (AMs)和NodeManagers (NMs) 会以轮训的方式寻找活动状态的RM,也就是说AM
s和NMs需要自己提供容错机制。如果当前活动状态的RM挂掉了,那么会继续使用轮训的方式找到新的RM。这种逻辑的实现需要在yarn.client.failover-proxy-provider中指定使用的类:org.apache.hadoop.yarn.client.RMFailoverProxyProvider
此外,新的RM可以恢复之前RM的状态(详见ResourceManger Restart )。当启动RM Restart,重启后的RM就加载之前活动RM的状态信息并继续之前RM的操作,这样应用程序定期执行检查点操作,就可以避免工作内容的丢失。在Active/standby的RM中,活动RM的状态数据需要active和standby都能访问,使用共享文件系统方法(FileSystemRMStateStore )或者zooKeeper方法(ZKRMStateStore)。后者在同一时间只允许一个RM有写入权限。

一个常见的YARN RM HA配置如下:

	yarn.resourcemanager.ha.enabled
	true
	yarn.resourcemanager.ha.rm-ids
	rm1,rm2
	yarn.resourcemanager.hostname.rm1
	debugo01
	yarn.resourcemanager.hostname.rm2
	debugo02
	yarn.resourcemanager.recovery.enabled
	true
	yarn.resourcemanager.store.class
        org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore
	yarn.resourcemanager.zk-address
        debugo01:2181,debugo02:2181,debugo03:2181
        For multiple zk services, separate them with comma
	yarn.resourcemanager.cluster-id
	yarn-ha
	yarn.resourcemanager.ha.automatic-failover.enabled
	true
	Enable automatic failover; By default, it is enabled only when HA is enabled.
  yarn.resourcemanager.ha.automatic-failover.zk-base-path
  /yarn-leader-election
Optional setting. The default value is /yarn-leader-election
	yarn.client.failover-proxy-provider
	org.apache.hadoop.yarn.client.RMFailoverProxyProvider

同时,yarn RM服务监听地址的设置要修改成下面的方式:

yarn.resourcemanager.address.rm1
debugo01:8132
yarn.resourcemanager.address.rm2
debugo02:8132
yarn.resourcemanager.scheduler.address.rm1
debugo01:8130
yarn.resourcemanager.scheduler.address.rm2
debugo02:8130
yarn.resourcemanager.resource-tracker.address.rm1
debugo01:8131
yarn.resourcemanager.resource-tracker.address.rm2
debugo02:8131 yarn.resourcemanager.webapp.address.rm1
debugo01:8188
yarn.resourcemanager.webapp.address.rm2
debugo02:8188

启动RM

start-yarn.sh

在standby的节点单独启动RM(也可使用start-yarn.sh脚本)

检查状态:

$ yarn rmadmin -getServiceState rm1
active
$ yarn rmadmin -getServiceState rm2
standby

访问rm2节点的nodemanager会提示
This is standby RM. Redirecting to the current active RM: http://debugo01:8188/cluster/apps
下面KILL掉rm1的resourcemanager

$ yarn rmadmin -getServiceState rm2
active
?$  yarn rmadmin -getServiceState rm1
14/09/14 03:08:23 INFO ipc.Client: Retrying connect to server: debugo01/192.168.46.201:8033. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=1, sleepTime=1000 MILLISECONDS)
Operation failed: Call From debugo01/192.168.46.201 to debugo01:8033 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

参考

http://hadoop.apache.org/docs/r2.4.1/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html

http://dongxicheng.org/mapreduce-nextgen/hadoop-yarn-ha-in-cdh5/

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL String Types: Storage, Performance, and Best PracticesMySQL String Types: Storage, Performance, and Best PracticesMay 10, 2025 am 12:02 AM

MySQLstringtypesimpactstorageandperformanceasfollows:1)CHARisfixed-length,alwaysusingthesamestoragespace,whichcanbefasterbutlessspace-efficient.2)VARCHARisvariable-length,morespace-efficientbutpotentiallyslower.3)TEXTisforlargetext,storedoutsiderows,

Understanding MySQL String Types: VARCHAR, TEXT, CHAR, and MoreUnderstanding MySQL String Types: VARCHAR, TEXT, CHAR, and MoreMay 10, 2025 am 12:02 AM

MySQLstringtypesincludeVARCHAR,TEXT,CHAR,ENUM,andSET.1)VARCHARisversatileforvariable-lengthstringsuptoaspecifiedlimit.2)TEXTisidealforlargetextstoragewithoutadefinedlength.3)CHARisfixed-length,suitableforconsistentdatalikecodes.4)ENUMenforcesdatainte

What are the String Data Types in MySQL?What are the String Data Types in MySQL?May 10, 2025 am 12:01 AM

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools