看了在yh_zookeeper下的logs的报错是:
2022-06-27 05:01:15,523 [myid:] - INFO [main:QuorumPeerConfig@135] - Reading configuration from: /home/centos/zookeeper1/install/yh_zookeeper/bin/../conf/zoo.cfg
2022-06-27 05:01:15,534 [myid:] - INFO [main:QuorumPeerConfig@387] - clientPortAddress is 0.0.0.0:2181
2022-06-27 05:01:15,534 [myid:] - INFO [main:QuorumPeerConfig@391] - secureClientPort is not set
2022-06-27 05:01:15,543 [myid:1] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 10
2022-06-27 05:01:15,543 [myid:1] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 1
2022-06-27 05:01:15,544 [myid:1] - INFO [PurgeTask:DatadirCleanupManager$PurgeTask@138] - Purge task started.
2022-06-27 05:01:15,549 [myid:1] - INFO [main:ManagedUtil@45] - Log4j 1.2 jmx support found and enabled.
2022-06-27 05:01:15,549 [myid:1] - INFO [PurgeTask:FileTxnSnapLog@115] - zookeeper.snapshot.trust.empty : false
2022-06-27 05:01:15,556 [myid:1] - INFO [PurgeTask:DatadirCleanupManager$PurgeTask@144] - Purge task completed.
2022-06-27 05:01:15,558 [myid:1] - INFO [main:QuorumPeerMain@141] - Starting quorum peer
2022-06-27 05:01:15,565 [myid:1] - INFO [main:ServerCnxnFactory@135] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2022-06-27 05:01:15,568 [myid:1] - INFO [main:NIOServerCnxnFactory@673] - Configuring NIO connection handler with 10s sessionless connection timeout, 2 selector thread(s), 16 worker threads, and 64 kB direct buffers.
2022-06-27 05:01:15,573 [myid:1] - INFO [main:NIOServerCnxnFactory@686] - binding to port 0.0.0.0/0.0.0.0:2181
2022-06-27 05:01:15,583 [myid:1] - INFO [main:X509Util@79] - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2022-06-27 05:01:15,584 [myid:1] - INFO [main:FileTxnSnapLog@115] - zookeeper.snapshot.trust.empty : false
2022-06-27 05:01:15,584 [myid:1] - INFO [main:QuorumPeer@1470] - Local sessions disabled
2022-06-27 05:01:15,585 [myid:1] - INFO [main:QuorumPeer@1481] - Local session upgrading disabled
2022-06-27 05:01:15,586 [myid:1] - INFO [main:QuorumPeer@1448] - tickTime set to 10000
2022-06-27 05:01:15,586 [myid:1] - INFO [main:QuorumPeer@1492] - minSessionTimeout set to 20000
2022-06-27 05:01:15,586 [myid:1] - INFO [main:QuorumPeer@1503] - maxSessionTimeout set to 60000000
2022-06-27 05:01:15,586 [myid:1] - INFO [main:QuorumPeer@1518] - initLimit set to 5
2022-06-27 05:01:15,596 [myid:1] - INFO [main:ZKDatabase@117] - zookeeper.snapshotSizeFactor = 0.33
2022-06-27 05:01:15,598 [myid:1] - INFO [main:QuorumPeer@1763] - Using insecure (non-TLS) quorum communication
2022-06-27 05:01:15,598 [myid:1] - INFO [main:QuorumPeer@1769] - Port unification disabled
2022-06-27 05:01:15,598 [myid:1] - INFO [main:QuorumPeer@2137] - QuorumPeer communication is not secured! (SASL auth disabled)
2022-06-27 05:01:15,598 [myid:1] - INFO [main:QuorumPeer@2166] - quorum.cnxn.threads.size set to 20
2022-06-27 05:01:15,601 [myid:1] - INFO [main:FileTxnSnapLog@404] - Snapshotting: 0x0 to /home/centos/zookeeper1/data/data/version-2/snapshot.0
2022-06-27 05:01:15,603 [myid:1] - INFO [main:QuorumPeer@913] - currentEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2022-06-27 05:01:15,607 [myid:1] - INFO [main:QuorumPeer@928] - acceptedEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2022-06-27 05:01:15,617 [myid:1] - INFO [main:QuorumCnxManager$Listener@878] - Election port bind maximum retries is 3
2022-06-27 05:01:15,618 [myid:1] - INFO [QuorumPeerListener:QuorumCnxManager$Listener@929] - 1 is accepting connections now, my election bind port: /52.83.193.201:2888
2022-06-27 05:01:15,620 [myid:1] - ERROR [/52.83.193.201:2888:QuorumCnxManager$Listener@958] - Exception while listening
java.net.BindException: Cannot assign requested address (Bind failed)
at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:452)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:381)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:335)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:931)
2022-06-27 05:01:15,628 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@1175] - LOOKING
2022-06-27 05:01:15,629 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@903] - New election. My id = 1, proposed zxid=0x0
2022-06-27 05:01:15,632 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection@697] - Notification: 2 (message format version), 1 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEPoch), LOOKING (my state)0 (n.config version)
2022-06-27 05:01:15,635 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-1:QuorumCnxManager@381] - Cannot open channel to 2 at election address /52.82.112.139:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:15,635 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-2:QuorumCnxManager@381] - Cannot open channel to 3 at election address /69.235.181.208:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:15,835 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@937] - Notification time out: 400
2022-06-27 05:01:15,836 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-3:QuorumCnxManager@381] - Cannot open channel to 2 at election address /52.82.112.139:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:15,836 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-2:QuorumCnxManager@381] - Cannot open channel to 3 at election address /69.235.181.208:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:16,235 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@937] - Notification time out: 800
2022-06-27 05:01:16,237 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-2:QuorumCnxManager@381] - Cannot open channel to 2 at election address /52.82.112.139:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:16,237 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-3:QuorumCnxManager@381] - Cannot open channel to 3 at election address /69.235.181.208:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:16,622 [myid:1] - INFO [/52.83.193.201:2888:QuorumCnxManager$Listener@929] - 1 is accepting connections now, my election bind port: /52.83.193.201:2888
2022-06-27 05:01:16,622 [myid:1] - ERROR [/52.83.193.201:2888:QuorumCnxManager$Listener@958] - Exception while listening
java.net.BindException: Cannot assign requested address (Bind failed)
at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:452)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:381)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:335)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:931)
2022-06-27 05:01:17,036 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@937] - Notification time out: 1600
2022-06-27 05:01:17,037 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-3:QuorumCnxManager@381] - Cannot open channel to 2 at election address /52.82.112.139:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:17,037 [myid:1] - WARN [QuorumConnectionThread-[myid=1]-2:QuorumCnxManager@381] - Cannot open channel to 3 at election address /69.235.181.208:2888
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:608)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:373)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$QuorumConnectionReqThread.run(QuorumCnxManager.java:436)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-06-27 05:01:17,622 [myid:1] - INFO [/52.83.193.201:2888:QuorumCnxManager$Listener@929] - 1 is accepting connections now, my election bind port: /52.83.193.201:2888
2022-06-27 05:01:17,623 [myid:1] - ERROR [/52.83.193.201:2888:QuorumCnxManager$Listener@958] - Exception while listening
java.net.BindException: Cannot assign requested address (Bind failed)
at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:452)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:381)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:335)
at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:931)
2022-06-27 05:01:18,623 [myid:1] - INFO [/52.83.193.201:2888:QuorumCnxManager$Listener@973] - Leaving listener
2022-06-27 05:01:18,624 [myid:1] - ERROR [/52.83.193.201:2888:QuorumCnxManager$Listener@975] - As I'm leaving the listener thread after 3 errors. I won't be able to participate in leader election any longer: 52.83.193.201:2888. Use zookeeper.electionPortBindRetry property to increase retry count.