diff options
-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); |