- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
kafka-console-producer.sh
- Labels:
-
Apache Kafka
-
Cloudera Manager
Created on 06-09-2019 07:14 AM - edited 09-16-2022 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am not able to produce the msg on cloudera. I am running below command get the error.
COMMAND:
kafka-console-producer.sh \
--broker-list localhost:9092 \
--topic kafkademo1
ERRPR MSG:
WARN [Producer clientId=console-producer] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
Need support in this regard.
Created 06-11-2019 07:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please use the below steps if your cluster is unsecure.
kafka-topics --create --zookeeper <zk host>:2181 --replication-factor 3 --partitions 1 --topic Testmessage
Run a Kafka console producer:
$ kafka-console-producer --broker-list <broker hostnome>:9092 --topic Testmessage
Run a Kafka console consumer:
$ kafka-console-consumer --new-consumer --topic Testmessage --from-beginning --bootstrap-server <broker hostnome>:9092
Thanks
Jerry
Created 06-10-2019 04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the logs, It seems its unable to find the broker "Connection to node -1 (localhost/127.0.0.1:9092) could not be established"
Make sure you have broker running in the node and listening to 9092
Also try adding the fully qualified name or IP instead of localhost
Thanks
Jerry
Created on 06-10-2019 11:17 PM - edited 06-10-2019 11:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jerry,
After replacing localhost to hostname "quickstart.cloudera" it is working , but now I am not getting messages in my consumers terminal. I follow the below commands.
kafka-console-producer.sh --broker-list quickstart.cloudera:9092 --topic test-1
>welcome to
>
kafka-console-consumer.sh --bootstrap-server quickstart.cloudera:9092 --topic test-1 --from-beginning
Pleaes let me know what could be the problem.
Regards,
Aamir
Created 06-11-2019 07:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please use the below steps if your cluster is unsecure.
kafka-topics --create --zookeeper <zk host>:2181 --replication-factor 3 --partitions 1 --topic Testmessage
Run a Kafka console producer:
$ kafka-console-producer --broker-list <broker hostnome>:9092 --topic Testmessage
Run a Kafka console consumer:
$ kafka-console-consumer --new-consumer --topic Testmessage --from-beginning --bootstrap-server <broker hostnome>:9092
Thanks
Jerry
Created 06-11-2019 07:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jerry,
It has starting working after I changed the property "offsets.topic.replication.factor" 3 to 1.
Thanks for your support.
Aamir.
