You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2023/06/23 10:10:18 UTC
[GitHub] [hadoop] slfan1989 commented on a diff in pull request #5766: YARN-11517. Improve Federation#RouterCLI DeregisterSubCluster Code.
slfan1989 commented on code in PR #5766:
URL: https://github.com/apache/hadoop/pull/5766#discussion_r1239637939
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestRouterCLI.java:
##########
@@ -120,7 +122,10 @@ public void testDeregisterSubCluster() throws Exception {
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
System.setOut(new PrintStream(dataOut));
oldOutPrintStream.println(dataOut);
- String[] args = {"-deregisterSubCluster", "-c", "SC-1"};
+ String[] args = {"-deregisterSubCluster", "-sc", "SC-1"};
Review Comment:
Apologies for the oversight. In the command, we wrote `-sc` as the option, but the actual input requires `-c`.
RouterCLI#ADMIN_USAGE
```
protected final static Map<String, UsageInfo> ADMIN_USAGE =
ImmutableMap.<String, UsageInfo>builder().put("-deregisterSubCluster",
new UsageInfo("[-sc|subClusterId [subCluster id]]",
"deregister subCluster, if the interval between the heartbeat time of the subCluster "
```
RouterCLI#handleDeregisterSubCluster
```
Options opts = new Options();
opts.addOption("deregisterSubCluster", false,
"Refresh the hosts information at the ResourceManager.");
Option gracefulOpt = new Option("c", "clusterId", true,
"Wait for timeout before marking the NodeManager as decommissioned.");
gracefulOpt.setOptionalArg(true);
opts.addOption(gracefulOpt);
```
In this pr, I have fixed this issue by allowing the use of `-sc` or `--subClusterId` to specify the subCluster.
Cmd1 : `yarn routeradmin -deregisterSubCluster`
<img width="1089" alt="image" src="https://github.com/apache/hadoop/assets/55643692/e7fcf521-0ca3-4717-8110-1ad8f20916cd">
Cmd2 : `yarn routeradmin -deregisterSubCluster -sc ClusterTest-Yarn1`
<img width="1078" alt="image" src="https://github.com/apache/hadoop/assets/55643692/5993e329-c41e-4378-b1d4-8d751fff6140">
Cmd3 :`yarn routeradmin -deregisterSubCluster --subClusterId ClusterTest-Yarn1`
<img width="1109" alt="image" src="https://github.com/apache/hadoop/assets/55643692/43824c44-b0fb-4a97-a1c6-a83804ec9961">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org