不尝试使用SASL进行身份验证(未知错误)

Bha*_*rat 6 solr apache-zookeeper

我正在尝试在ec2的两个实例上设置zookeeper。如这里这里所给。我正在尝试运行zookeeper,但失败并显示以下错误:命令:bin/zkCli.sh -server localhost:2181

> 2015-03-15 00:22:35,644 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@3ff0efca
Welcome to ZooKeeper!
2015-03-15 00:22:35,671 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@975] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2015-03-15 00:22:35,677 [myid:] - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1102] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[zk: localhost:2181(CONNECTING) 0] 2015-03-15 00:22:36,796 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@975] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2015-03-15 00:22:36,797 [myid:] - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1102] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
Run Code Online (Sandbox Code Playgroud)

zoo.cfg作为波纹管

tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/lib/zookeeper
clientPort=2181
server.1=localhost:2888:3888
server.2=<My ec2 private IPs>:2889:3889
Run Code Online (Sandbox Code Playgroud)

我也在两个ec2实例上都创建了myId文件- /var/lib/zookeeper/myid

我也尝试编辑/ ect / hosts文件,但仍然面临相同的问题。还如何通过1命令启动两个zookeeper实例?

注意:如果我尝试使用bin/zkCli.sh start命令,服务器将成功启动。

提前致谢!

小智 3

查看zk日志zookeeper.out\xef\xbc\x8c如果有连接限制错误,配置如下到zoo.cfg。

\n\n
# the maximum number of client connections.\n# increase this if you need to handle more clients\nmaxClientCnxns=60\n
Run Code Online (Sandbox Code Playgroud)\n