[ https://issues.apache.org/jira/browse/YARN-11706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871696#comment-17871696 ]
ASF GitHub Bot commented on YARN-11706: --------------------------------------- zeekling commented on code in PR #6957: URL: https://github.com/apache/hadoop/pull/6957#discussion_r1707205446 ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java: ########## @@ -757,6 +768,28 @@ private int replaceLabelsOnNodes(Map<NodeId, Set<String>> map, return 0; } + private int failover(CommandLine cmd) + throws IOException, ServiceFailedException { + int numOpts = cmd.getOptions() == null ? 0 : cmd.getOptions().length; + final String[] args = cmd.getArgs(); + if (numOpts > 1 || args.length != 2) { + errOut.println("failover: incorrect arguments"); + printUsage(errOut, "-failover", YARN_HA_USAGE); + return -1; + } + HAServiceTarget fromNode = resolveTarget(args[0]); + HAServiceTarget toNode = resolveTarget(args[1]); + setRequestSource(HAServiceProtocol.RequestSource.REQUEST_BY_USER_FORCED); + HAServiceProtocol proto = fromNode.getProxy( + getConf(), 0); + HAServiceProtocolHelper.transitionToStandby(proto, createReqInfo()); + HAServiceProtocol proto1 = toNode.getProxy( + getConf(), 0); + HAServiceProtocolHelper.transitionToActive(proto1, createReqInfo()); Review Comment: Do we need to check whether args[1] is the primary? If it is the primary, there is no need to switch. ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java: ########## @@ -172,6 +175,14 @@ public class RMAdminCLI extends HAAdmin { "Update resource on specific node.")) .build(); + private final static Map<String, UsageInfo> YARN_HA_USAGE = + ImmutableMap.<String, UsageInfo> builder() + .put("-failover", new UsageInfo( + "<serviceId> <serviceId>", Review Comment: What does means? > Make yarn rmadmin tool support failover function > ------------------------------------------------- > > Key: YARN-11706 > URL: https://issues.apache.org/jira/browse/YARN-11706 > Project: Hadoop YARN > Issue Type: New Feature > Affects Versions: 3.3.6 > Reporter: wangzhongwei > Assignee: wangzhongwei > Priority: Major > Labels: pull-request-available > > 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 -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org