[ 
https://issues.apache.org/jira/browse/YARN-11706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871902#comment-17871902
 ] 

ASF GitHub Bot commented on YARN-11706:
---------------------------------------

granewang commented on code in PR #6957:
URL: https://github.com/apache/hadoop/pull/6957#discussion_r1708899262


##########
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:
   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;**
       }
   ....
   "





> 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

Reply via email to