linux的zookeeper安装遇到的问题

1.我的安装好后启动不起来,查看日志显示:

2019-09-04 18:18:26,064 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382] - Cannot open channel to 3 at election address node03/192.168.17.103:3888
java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:579)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:368)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:402)
	at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:840)
	at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:762)
2019-09-04 18:18:26,069 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@382] - Cannot open channel to 4 at election address node04/192.168.17.104:3888
java.net.ConnectException: Connection refused

其实这个不是什么问题的,就是需要你把其他的几台机器启动就ok了,之后我依次把node02----到------node05全部启动

./bin/zkServer.sh start      然后查看状态status就好了

linux的zookeeper安装遇到的问题_第1张图片

2.还有之前一个占用端口的问题。报错的信息显示如下:

Using config: /data/zookeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
2019-09-04 17:57:23,730 [myid:] - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /data/zookeper/zookeeper-3.4.6/bin/../conf/zoo.cfg
2019-09-04 17:57:23,735 [myid:] - INFO  [main:QuorumPeerConfig@340] - Defaulting to majority quorums
2019-09-04 17:57:23,739 [myid:2] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2019-09-04 17:57:23,739 [myid:2] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2019-09-04 17:57:23,740 [myid:2] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2019-09-04 17:57:23,750 [myid:2] - INFO  [main:QuorumPeerMain@127] - Starting quorum peer
2019-09-04 17:57:23,806 [myid:2] - INFO  [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:2181
2019-09-04 17:57:23,807 [myid:2] - ERROR [main:QuorumPeerMain@89] - Unexpected exception, exiting abnormally
java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:444)
	at sun.nio.ch.Net.bind(Net.java:436)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
	at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:95)
	at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:130)
	at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
	at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

./bin/zkServer.sh start-foreground

查看下端口:

办法,kill掉他就好了。重新启动后问题解决。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(开发笔记,zookeeper)