From 9e72b697a2eab06488ca89e857afd0db7b5e7197 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Mon, 26 Jul 2021 16:46:07 +0900 Subject: [PATCH] HDFS-16140. TestBootstrapAliasmap fails by BindException. (#3229) Reviewed-by: Hui Fei (cherry picked from commit d710ec8d85692e4c2f915db1474b15dba84af666) --- .../hadoop/hdfs/server/namenode/ha/TestBootstrapAliasmap.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestBootstrapAliasmap.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestBootstrapAliasmap.java index 715622645e..41db9433de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestBootstrapAliasmap.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestBootstrapAliasmap.java @@ -51,6 +51,9 @@ public class TestBootstrapAliasmap { public void setup() throws Exception { Configuration conf = new Configuration(); MiniDFSCluster.setupNamenodeProvidedConfiguration(conf); + // use free port instead of default 50200 port + conf.set(DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_ADDRESS, + "127.0.0.1:" + NetUtils.getFreeSocketPort()); cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(1) .build();