Get startedGet started for free

Error on start

When working with Kafka, you've tried many iterations while trying to determine the best configuration for your cluster. After many iterations, you suddenly see the error message below:

WARN Session 0x0 for server localhost/127.0.0.1:2181, Closing socket connection. 
Attempting reconnect except it is a SessionExpiredException. (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: Connection refused
    at java.base/sun.nio.ch.Net.pollConnect(Native Method)
    at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source)
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:344)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1289)

You receive the error above after trying to start the Kafka service with bin/kafka-server-start.sh config/server.properties. Which of the following is the likely problem?

This exercise is part of the course

Introduction to Apache Kafka

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise