From 3acc117919369d7990f1491ea9eca6c727969c73 Mon Sep 17 00:00:00 2001 From: Wanqiang Ji Date: Sun, 21 Jul 2019 10:51:42 +0800 Subject: [PATCH] YARN-9635. Nodes page displayed duplicate nodes --- .../org/apache/hadoop/yarn/conf/YarnConfiguration.java | 2 +- .../src/main/resources/yarn-default.xml | 8 ++++++-- .../hadoop-yarn-site/src/site/markdown/NodeManager.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index 548d868a68f..742d24a6008 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -1166,7 +1166,7 @@ public static boolean isAclEnabled(Configuration conf) { /** address of node manager IPC.*/ public static final String NM_ADDRESS = NM_PREFIX + "address"; - public static final int DEFAULT_NM_PORT = 0; + public static final int DEFAULT_NM_PORT = 45454; public static final String DEFAULT_NM_ADDRESS = "0.0.0.0:" + DEFAULT_NM_PORT; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml index 8582522b633..2c83ceb6776 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml @@ -1047,9 +1047,13 @@ - The address of the container manager in the NM. + + The address of the container manager in the NM. If you using ephemeral + port (the port is 0), the node will changed after restart and NM are seen + as new node by RM. So you will see the duplicate node in the nodes page. + yarn.nodemanager.address - ${yarn.nodemanager.hostname}:0 + ${yarn.nodemanager.hostname}:45454 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManager.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManager.md index 5b9f0ef8200..a4d04d2a94b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManager.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManager.md @@ -87,7 +87,7 @@ Step 4. Configure a valid RPC address for the NodeManager. | Property | Description | |:---- |:---- | -| `yarn.nodemanager.address` | Ephemeral ports (port 0, which is default) cannot be used for the NodeManager's RPC server specified via yarn.nodemanager.address as it can make NM use different ports before and after a restart. This will break any previously running clients that were communicating with the NM before restart. Explicitly setting yarn.nodemanager.address to an address with specific port number (for e.g 0.0.0.0:45454) is a precondition for enabling NM restart. | +| `yarn.nodemanager.address` | Ephemeral ports (port 0) cannot be used for the NodeManager's RPC server specified via yarn.nodemanager.address as it can make NM use different ports before and after a restart. This will break any previously running clients that were communicating with the NM before restart. Explicitly setting yarn.nodemanager.address to an address with specific port number (for e.g 0.0.0.0:45454) is a precondition for enabling NM restart. | Step 5. Auxiliary services. -- 2.20.1 (Apple Git-117)