HBASE-27420 Allow non-loopback for zk standalone server in minizkcluster (#4819)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
Co-authored-by: Sanjeet Malhotra <sanjeetmalhotra@salesforce.com>
This commit is contained in:
sanjeet006py 2022-10-11 23:05:57 +05:30 committed by Andrew Purtell
parent 39978b80ab
commit 72c79b6a31
1 changed files with 3 additions and 1 deletions

View File

@ -235,7 +235,9 @@ public class MiniZooKeeperCluster {
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) {