Zookeeper启动失败(java.net.BindException: 地址已在使用)

原创 2016年06月13日 16:24:21


[hadoop@DEV22 ~]$ opt/zookeeper-3.4.8/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/hadoop/opt/zookeeper-3.4.8/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[hadoop@DEV22 ~]$ jps
8637 Jps
[hadoop@DEV22 ~]$ cat zookeeper.out 
2016-06-13 15:55:17,304 [myid:] - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /home/hadoop/opt/zookeeper-3.4.8/bin/../conf/zoo.cfg
2016-06-13 15:55:17,315 [myid:] - INFO  [main:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.0.72 to address: /192.168.0.72
2016-06-13 15:55:17,315 [myid:] - INFO  [main:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.0.83 to address: /192.168.0.83
2016-06-13 15:55:17,316 [myid:] - INFO  [main:QuorumPeer$QuorumServer@149] - Resolved hostname: 192.168.0.73 to address: /192.168.0.73
2016-06-13 15:55:17,316 [myid:] - INFO  [main:QuorumPeerConfig@331] - Defaulting to majority quorums
2016-06-13 15:55:17,321 [myid:1] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2016-06-13 15:55:17,321 [myid:1] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2016-06-13 15:55:17,321 [myid:1] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2016-06-13 15:55:17,331 [myid:1] - INFO  [main:QuorumPeerMain@127] - Starting quorum peer
2016-06-13 15:55:17,337 [myid:1] - INFO  [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181
2016-06-13 15:55:17,337 [myid:1] - ERROR [main:QuorumPeerMain@89] - Unexpected exception, exiting abnormally
java.net.BindException: 地址已在使用
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:463)
	at sun.nio.ch.Net.bind(Net.java:455)
	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:90)
	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)

端口被占用了,把2181端口改成别的就可以了

[hadoop@DEV22 ~]$ vi opt/zookeeper-3.4.8/conf/zoo.cfg 
[hadoop@DEV22 ~]$ opt/zookeeper-3.4.8/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/hadoop/opt/zookeeper-3.4.8/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[hadoop@DEV22 ~]$ jps
8694 QuorumPeerMain
8728 Jps


PS:

以下针对不同版本的Linux系统检查防火墙的状态,及关闭防火墙:

---------------------------------------------------------------

Ubuntu(ubuntu-12.04-desktop-amd64

查看防火墙状态:ufw status

关闭防火墙:ufw disable

---------------------------------------------------------------

centos6.0

查看防火墙状态:service iptables status

关闭防火墙:chkconfig iptables off    #开机不启动防火墙服务

--------------------------------------------------------------

centos7.0(默认是使用firewall作为防火墙,如若未改为iptables防火墙,使用以下命令查看和关闭防火墙)

查看防火墙状态:firewall-cmd --state

关闭防火墙:systemctl stop firewalld.service



版权声明:本文为博主原创文章,转载请加上原文地址,谢谢!

java.net.BindException: 地址已在使用

java.net.BindException: 地址已在使用 java.net.BindException: 地址已在使用,也可以说是端口被占用,通常出现在启动服务的时候。 1、出错地方如图所示:...

org.mortbay.util.MultiException[java.net.BindException: 地址已在使用

原因:  通常是端口被占用  排查方法:         首先,利用 netstat -alnp | grep 8080 查看端口使用情况 (可跳过)        利用 jps -v  |gr...

ava.net.BindException: Problem binding to [ubuntu-master:9000] java.net.BindException: 地址已在使用; For m

java.net.BindException: Problem binding to [ubuntu-master:9000] java.net.BindException: 地址已在使用; For ...

zookeeper启动失败的排错

运行zookeeperd后显示启动成功: JMX enabled by default Using config: /data/programfiles/zookeeper-3.4.5/b...
  • newjueqi
  • newjueqi
  • 2014年08月12日 17:57
  • 51980

启动hbase 报错 Address already in use 的解决办法

master: java.net.BindException: Address already in use master:         at sun.nio.ch.Net.bind(Nativ...

解决报错:java.net.BindException: 无法指定被请求的地址

今天在linux虚拟机上装了tomcat,但是一直启动不了,查看日志,主要报错如下:严重: StandardServer.await: create[localhost:8005]: java.net...

Zookeeper无法启动

几种常见的zookeeper启动错误。

Amazon EC2上配置集群出现zookeeper启动失败的排错

转自:zookeeper启动失败的排错,保存在此以学习。 1.执行zkServer.sh start 后显示: JMX enabled by default Using config:/home/...

Zookeeper集群模式无法部署云服务器【java.net.BindException: 无法指定被请求的地址 (Bind failed)】的解决

前言本篇心路历程太多,放在最后了。正文在云服务器(阿里云、腾讯云)上部署Zookeeper集群模式时,无法成功的原因有很多,网上主要提到了端口被占用(未开放)和防火墙开启两种问题,类似的博客很多,本文...

zookeeper启动失败的排错

1.执行zkServer.sh start 后显示: JMX enabled by default Using config:/home/hadoop/app/zookeeper-3.4.5/bi...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Zookeeper启动失败(java.net.BindException: 地址已在使用)
举报原因:
原因补充:

(最多只允许输入30个字)