Support Questions

Find answers, ask questions, and share your expertise

Running Kafka Producer/Consumer with Kerberos

We are trying to setup Kafka with kerberos and facing some issue in running defaultproducer/consumer example.

Taken help from :

[tarun.kumar@aw1frtdvhdp02 bin]$ /usr/hdp/current/kafka-broker/bin/ --broker-list localhost:6667 --topic test


[2017-05-29 14:11:56,293] ERROR Error when sending message to topic test with key: null, value: 5 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)

While trying to run the producer/consumer above ways seeing above error.

Can anyone please help me in understanding /resolving this ?


Rising Star

@Tarun Kumar

Please add the option --security-protocol SASL_PLAINTEXT to your producer command (depending upon the security protocol that you have configured) and also instead of localhost, use broker hostname:

$ /usr/hdp/current/kafka-broker/bin/ --broker-list <broker_hostname>:6667 --topic test --security-protocol SASL_PLAINTEXT

Thank you!