ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain) java.net.BindException: Address already in use

+1 vote

Hi everyone,

I am getting this error when try to start kafka server.

[2020-02-05 13:29:34,028] INFO Server environment:user.dir=/root/Desktop/kafka (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-05 13:29:34,073] INFO tickTime set to 3000 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-05 13:29:34,074] INFO minSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-05 13:29:34,074] INFO maxSessionTimeout set to -1 (org.apache.zookeeper.server.ZooKeeperServer)
[2020-02-05 13:29:34,429] INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2020-02-05 13:29:34,438] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.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.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:111)
    at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
    at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

Can anyone help me to solve this?

Thank You

Feb 5 in Apache Kafka by akhtar
• 25,030 points
2,019 views

1 answer to this question.

0 votes

Hi@akhtar,

Here the zookeeper service is already started in your  node. So you can stop and the zookeeper service again.

$ ./bin/zookeeper-server-start.sh config/zookeeper.properties

$ kill -9 ID

$ ./bin/zookeeper-server.stop.sh config/zookeeper.properties

Thank You

answered Feb 5 by MD
• 56,480 points

Related Questions In Apache Kafka

0 votes
1 answer
+2 votes
2 answers

Getting error in schema-registry start command

It is working for me with below ...READ MORE

answered Sep 30, 2019 in Apache Kafka by Brajkishore
• 220 points
1,188 views
0 votes
1 answer

What filter transformation in apache spark?

Hi, Filter() transformation in Apache Spark takes function ...READ MORE

answered Aug 2, 2019 in Apache Kafka by Gitika
• 37,370 points
144 views
+1 vote
2 answers
0 votes
1 answer
+1 vote
1 answer

What is the importance of Kafka bootstrap.servers?

Hi@akhtar, Bootstrap.servers is a mandatory field in Kafka ...READ MORE

answered Feb 11 in Apache Kafka by MD
• 56,480 points
4,176 views
+1 vote
2 answers

What is the need of zookeeper in kafka? Can I use kafka without zookeeper?

At present, There is no any alternative ...READ MORE

answered Jun 17 in Apache Kafka by Pawan
• 380 points
2,606 views