Hadoop HA中zkfc格式化失败或报错!

21/11/17 08:38:58 INFO zookeeper.ClientCnxn: Opening socket connection to server node-02/192.168.81.135:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:38:58 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:38:58 INFO zookeeper.ClientCnxn: Opening socket connection to server node-01/192.168.81.134:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:38:58 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:38:58 INFO zookeeper.ClientCnxn: Opening socket connection to server node-03/192.168.81.136:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:38:58 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:38:59 INFO zookeeper.ClientCnxn: Opening socket connection to server node-02/192.168.81.135:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:38:59 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:38:59 INFO zookeeper.ClientCnxn: Opening socket connection to server node-01/192.168.81.134:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:38:59 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:00 INFO zookeeper.ClientCnxn: Opening socket connection to server node-03/192.168.81.136:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:00 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:01 INFO zookeeper.ClientCnxn: Opening socket connection to server node-02/192.168.81.135:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:01 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:01 INFO zookeeper.ClientCnxn: Opening socket connection to server node-01/192.168.81.134:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:01 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:01 INFO zookeeper.ClientCnxn: Opening socket connection to server node-03/192.168.81.136:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:01 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:02 INFO zookeeper.ClientCnxn: Opening socket connection to server node-02/192.168.81.135:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:02 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:02 INFO zookeeper.ClientCnxn: Opening socket connection to server node-01/192.168.81.134:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:02 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:02 INFO zookeeper.ClientCnxn: Opening socket connection to server node-03/192.168.81.136:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:02 WARN zookeeper.ClientCnxn: 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:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
21/11/17 08:39:03 ERROR ha.ActiveStandbyElector: Connection timed out: couldn't connect to ZooKeeper in 5000 milliseconds
21/11/17 08:39:03 INFO zookeeper.ClientCnxn: Opening socket connection to server node-02/192.168.81.135:2128. Will not attempt to authenticate using SASL (unknown error)
21/11/17 08:39:03 INFO zookeeper.ZooKeeper: Session: 0x0 closed
21/11/17 08:39:03 INFO zookeeper.ClientCnxn: EventThread shut down
21/11/17 08:39:03 FATAL ha.ZKFailoverController: Unable to start failover controller. Unable to connect to ZooKeeper quorum at node-01:2128,node-02:2128,node-03:2128. Please check the configured value for ha.zookeeper.quorum and ensure that ZooKeeper is running.

以上错误内容,急用请赐教!

看看自己是不是在/etc/hosts设置文件里给127.0.0.1配置了像xxxxx这样的主机名,去掉127.0.0.1额外配的主机名应该就可以了,还有就是zk节点数最好是大于1的奇数,别弄成偶数了