HBASE-9425 Starting a LocalHBaseCluster when 2181 is occupied results in "Too many open files"
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1523809 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1b4bed1a21
commit
2ee04ae2cf
|
@ -134,7 +134,8 @@ public class MiniZooKeeperCluster {
|
|||
/**
|
||||
* @param baseDir
|
||||
* @param numZooKeeperServers
|
||||
* @return ClientPort server bound to.
|
||||
* @return ClientPort server bound to, -1 if there was a
|
||||
* binding problem and we couldn't pick another port.
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
|
@ -169,7 +170,9 @@ public class MiniZooKeeperCluster {
|
|||
1000));
|
||||
} catch (BindException e) {
|
||||
LOG.debug("Failed binding ZK Server to client port: " +
|
||||
tentativePort);
|
||||
tentativePort, e);
|
||||
// We're told to use some port but it's occupied, fail
|
||||
if (defaultClientPort > 0) return -1;
|
||||
// This port is already in use, try to use another.
|
||||
tentativePort = selectClientPort();
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue