-
Notifications
You must be signed in to change notification settings - Fork 9.1k
YARN-11706. Make yarn rmadmin tool support failover function #6957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
c09e59d
to
8a4f048
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
10efb5c
to
b350b8b
Compare
Fix blanks eol,while the checkstyle error is keeping with the legacy code,the legacy code checkstyle fixed pr:#6958 |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
private final static Map<String, UsageInfo> YARN_HA_USAGE = | ||
ImmutableMap.<String, UsageInfo> builder() | ||
.put("-failover", new UsageInfo( | ||
"<serviceId> <serviceId>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review ,
USAGE from HAAdmin.java does not contain usage and help information about failover,so YARN_HA_USAGE structure is added here for appending these information
HAServiceProtocolHelper.transitionToStandby(proto, createReqInfo()); | ||
HAServiceProtocol proto1 = toNode.getProxy( | ||
getConf(), 0); | ||
HAServiceProtocolHelper.transitionToActive(proto1, createReqInfo()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check whether args[1] is the primary? If it is the primary, there is no need to switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If args[1] is the primary,it will return :
HAServiceProtocolHelper.transitionToActive ->AdminService.java(transitionToActive):
"
@OverRide
public synchronized void transitionToActive(
HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException {
if (isRMActive()) {
return;
}
....
"
Description of PR
Currently,yarn rmadmin can not support failover,This failover step is just the same as step :
yarn rmadmin -transitionToStandby -forcemanual rm1
yarn rmadmin -transitionToActive -forcemanual rm2
How was this patch tested?
change the active node from rm1 to rm2:
yarn rmadmin -failover rm1 rm2