I set on a ubuntu node of a cluster a kafka 0.11.0.0 instance. Until some weeks ago everything worked fine, today I\'m trying to starting it and I obtain this error after th
uncomment this line
listeners=PLAINTEXT://:9092
changed this to
listeners=PLAINTEXT://127.0.0.1:9092
I also had the same issue...
So I start by asking Zookeeper some data
echo dump | nc localhost 2181
I get back something like this
SessionTracker dump:
Session Sets (3):
0 expire at Sun Dec 03 18:15:48 GST 2017:
0 expire at Sun Dec 03 18:15:51 GST 2017:
1 expire at Sun Dec 03 18:15:54 GST 2017:
0x1601c9a25190000
ephemeral nodes dump:
Sessions with Ephemerals (1):
0x1601c9a25190000:
/controller
/brokers/ids/0
I read this to mean that I have 1 Broker available - and it is has an id of 0.
So, lets find about that broker.
bin/zookeeper-shell.sh localhost:2181 <<< "get /brokers/ids/0"
And I see
{"listener_security_protocol_map":{"PLAINTEXT":"PLAINTEXT"},"endpoints":["PLAINTEXT://192.168.1.220:9092"],"jmx_port":-1,"host":"192.168.1.220","timestamp":"1512308520781","port":9092,"version":4}
cZxid = 0x69
ctime = Sun Dec 03 17:42:00 GST 2017
mZxid = 0x69
mtime = Sun Dec 03 17:42:00 GST 2017
pZxid = 0x69
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x1601c9a25190000
dataLength = 196
numChildren = 0
This rather startled me ... PLAINTEXT://192.168.1.220:9092, so when I changed my connect string to read
bin/kafka-console-producer.sh --broker-list PLAINTEXT://192.168.1.220:9092 --topic test
It all now worked.
Good luck !!
I was also facing the same problem on WINDOWS 10 and went through all the answers in this post. What caused this problem for me and how I solved is this, On my fresh windows machine, I did a jre (jre-8u221) installation and then followed the steps mentioned in Apache Kafka documentation to start zookeeper, kafka server, send messages through producer etc. But I was getting errors related to broker not available. I then downloaded jdk (jdk-8u221 from Oracle) and installed it. Set the JAVA_HOME and Path variables and restarted the machine. Everything after worked in one go.
I'm sure this is solved by now but I was getting this on a Kafka client running on an AWS ECS task trying to connect to a Kafka cluster running on EC2 instances and the problem was the security groups. Adding the CIDRS of all ECS task's allowed subnets (ECS -> cluster -> task -> details -> allowed subents) in the list of inbound rules for the cluster (ec2 -> instances -> security -> (select your security group) -> edit inbound rules -> (custom TCP/9092/CIDR) -> Add Rule) solved the issue.