错误日志如下:
[hadoop@master zookeeper-3.4.5-cdh5.10.0]$ cat zookeeper.out 2018-05-15 01:29:21,036 [myid:] - INFO [main:QuorumPeerConfig@101] - Reading configuration from: /opt/modules/zookeeper-3.4.5-cdh5.10.0/bin/../conf/zoo.cfg2018-05-15 01:29:21,045 [myid:] - INFO [main:QuorumPeerConfig@334] - Defaulting to majority quorums2018-05-15 01:29:21,048 [myid:1] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 32018-05-15 01:29:21,048 [myid:1] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 02018-05-15 01:29:21,049 [myid:1] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.2018-05-15 01:29:21,065 [myid:1] - INFO [main:QuorumPeerMain@132] - Starting quorum peer2018-05-15 01:29:21,074 [myid:1] - INFO [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:21812018-05-15 01:29:21,076 [myid:1] - ERROR [main:QuorumPeerMain@94] - Unexpected exception, exiting abnormallyjava.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) 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:135) at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116) at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
如日志中红色字体所示,该错误是由于Zookeeper对应的端口号被占用导致的。
查看端口占用情况:
[hadoop@master zookeeper-3.4.5-cdh5.10.0]$ sudo netstat -nltp | grep 2181tcp 0 0 :::2181 :::* LISTEN 3071/java
如上所示,占用Zookeeper对应端口号的应用是java,只需要kill掉该应用就能成功启动Zookeeper了。
[hadoop@master zookeeper-3.4.5-cdh5.10.0]$ sudo kill -9 3071
重启如下:
[hadoop@master zookeeper-3.4.5-cdh5.10.0]$ bin/zkServer.sh startJMX enabled by defaultUsing config: /opt/modules/zookeeper-3.4.5-cdh5.10.0/bin/../conf/zoo.cfgStarting zookeeper ... STARTED[hadoop@master zookeeper-3.4.5-cdh5.10.0]$ jps6481 Jps5330 DataNode5733 ResourceManager5077 DFSZKFailoverController6456 QuorumPeerMain5225 NameNode5514 JournalNode5837 NodeManager
Zookeeper启动成功!
以上就是博主为大家介绍的这一板块的主要内容,这都是博主自己的学习过程,希望能给大家带来一定的指导作用,有用的还望大家点个支持,如果对你没用也望包涵,有错误烦请指出。如有期待可关注博主以第一时间获取更新哦,谢谢!
版权声明:本文为博主原创文章,未经博主允许不得转载。