I can connect locally to the Zookeeper instance:
[zookeeperServer] # zkCli.sh -server 127.0.0.1:2181
However, if I try to do this through the forwarded SSH port, it first connects and then disconnects immediately:
[myLaptop] # ssh -L 1234: 127.0.0.1: 2181 zookeeperServer
[myLaptop] # zkCli.sh -server 127.0.0.1:1234
2014-10-03 15:25:18,989 [myid:] - INFO [main-SendThread(127.0.0.1:1234): ClientCnxn$SendThread@852 ] - Socket connection established to 127.0.0.1/127.0.0.1:1234, initiating session [zk: 127.0.0.1:1234(CONNECTING) 0] 2014-10-03 15:25:19,836 [myid:] - INFO [main-SendThread(127.0.0.1:1234): ClientCnxn$SendThread@1098 ] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect 2014-10-03 15:25:21,923 [myid:] - INFO [main-SendThread(127.0.0.1:1234): ClientCnxn$SendThread@975 ] - Opening socket connection to server 127.0.0.1/127.0.0.1:1234. Will not attempt to authenticate using SASL (unknown error) 2014-10-03 15:25:21,924 [myid:] - INFO [main-SendThread(127.0.0.1:1234): ClientCnxn$SendThread@852 ] - Socket connection established to 127.0.0.1/127.0.0.1:1234, initiating session 2014-10-03 15:25:22,352 [myid:] - INFO [main-SendThread(127.0.0.1:1234): ClientCnxn$SendThread@1098 ] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
..... previous 3 lines (Opening a socket, Established socket connection, Unable to read additional data) start repeating .....
Is there anything else (some hostnames, etc.) that Zookeeper depends on, and what needs to be configured so that the connection with Zookeeper works on the forwarded port?
source share