From e12527f1a5264ef989368e7bd6db8a768172eff3 Mon Sep 17 00:00:00 2001 From: Sanjeet Malhotra Date: Sat, 8 Oct 2022 05:19:36 +0530 Subject: [PATCH 1/2] Allow non-loopback for zk standalone server in minizkcluster --- .../apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java index 6d21fb57588c..3219bafe07b8 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java @@ -237,7 +237,8 @@ public int startup(File baseDir, int numZooKeeperServers) while (true) { try { standaloneServerFactory = new NIOServerCnxnFactory(); - standaloneServerFactory.configure(new InetSocketAddress(LOOPBACK_HOST, currentClientPort), + String bindAddr = configuration.get("hbase.zookeeper.property.clientPortAddress", LOOPBACK_HOST); + standaloneServerFactory.configure(new InetSocketAddress(bindAddr, currentClientPort), configuration.getInt(HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS, HConstants.DEFAULT_ZOOKEEPER_MAX_CLIENT_CNXNS)); } catch (BindException e) { From fab71841bd3cbdd512260338045b2c025d11bc8e Mon Sep 17 00:00:00 2001 From: Sanjeet Malhotra Date: Sat, 8 Oct 2022 06:50:41 +0530 Subject: [PATCH 2/2] Apply spotless fix --- .../apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java index 3219bafe07b8..c9a9e1f5fca5 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java @@ -237,7 +237,8 @@ public int startup(File baseDir, int numZooKeeperServers) while (true) { try { standaloneServerFactory = new NIOServerCnxnFactory(); - String bindAddr = configuration.get("hbase.zookeeper.property.clientPortAddress", LOOPBACK_HOST); + String bindAddr = + configuration.get("hbase.zookeeper.property.clientPortAddress", LOOPBACK_HOST); standaloneServerFactory.configure(new InetSocketAddress(bindAddr, currentClientPort), configuration.getInt(HConstants.ZOOKEEPER_MAX_CLIENT_CNXNS, HConstants.DEFAULT_ZOOKEEPER_MAX_CLIENT_CNXNS));