我可以在本地连接到我的Zookeeper实例:
[zookeeperServer] #zkCli.sh -server 127.0.0.1:2181
但是,如果我尝试通过SSH转发端口进行操作,它最初会连接,但会立即断开连接:
[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
..... 前3行(打开套接字,已建立套接字连接,无法读取其他数据)开始重复 .....
还有什么其他的(一些主机名等)Zookeeper依赖,需要配置以便与Zookeeper的连接在转发端口上工作?