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 GitHub
parent 2cc6478538
commit b656456e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -237,7 +237,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) {