diff options
author | bratseth <bratseth@yahoo-inc.com> | 2016-08-26 15:07:22 +0200 |
---|---|---|
committer | bratseth <bratseth@yahoo-inc.com> | 2016-08-26 15:07:22 +0200 |
commit | 43cd67fbbead0f084f32aedf00180bb36def5bc7 (patch) | |
tree | 5ca4c5861fae9612a3e0e8a093839936e082865e /zkfacade/src | |
parent | 7f9bf6b4ebe3d3aa814257ea057bb98b75a07afa (diff) |
Allow localhost
Diffstat (limited to 'zkfacade/src')
-rw-r--r-- | zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java index 4456970b130..ae7df9ac7cf 100644 --- a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java +++ b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java @@ -40,9 +40,9 @@ public class RestrictedServerCnxnFactory extends NIOServerCnxnFactory { @Override protected NIOServerCnxn createConnection(SocketChannel socket, SelectionKey selection) throws IOException { String remoteHost = ((InetSocketAddress)socket.getRemoteAddress()).getHostName(); - if ( ! zooKeeperServerHostnames.contains(remoteHost)) { + if ( ! remoteHost.equals("localhost") && ! zooKeeperServerHostnames.contains(remoteHost)) { String errorMessage = "Rejecting connection to ZooKeeper from " + remoteHost + - ": This cluster only allow connection from nodes in this cluster. " + + ": This cluster only allow connection among its own hosts. " + "Hosts in this cluster: " + zooKeeperServerHostnames; log.warning(errorMessage); throw new IllegalArgumentException(errorMessage); |