Reputation: 2022
I first create a topic test using the command
/opt/cloudera/parcels/KAFKA/bin/kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Then when I try to insert a new message to a topic in Kafka using the command
/opt/cloudera/parcels/KAFKA/bin/kafka-console-producer --broker-list localhost:2181 --topic test
Then I enter a message like "name":"Ashish"
I get the error
"received -1 from channel reading from source socket has likely been closed" !
What am I doing wrong here?
Any pointers to the solution or help will be appreciated.
Upvotes: 0
Views: 1274
Reputation: 8171
The --broker-list
arguments expect to have the Kafka broker Id not the zookeeper one. In your case you have mentioned the zookeeper host:port which is running at port 2181
. By default kafka broker listen on port 9092
.
Change --broker-host localhost:2181
to --broker-host localhost:9092
to see if it helps (assuming the kafka broker is running in the same machine, otherwise replace lcoalhost with the machine ip)
Upvotes: 3