Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Producer not able to submit the messages to kafka in kerberos enabled cluster.

Highlighted

Producer not able to submit the messages to kafka in kerberos enabled cluster.

New Contributor

Hi All,

We have kerberos enabled kafka cluster. I am trying to publish the messages using a scala producer program as below and we have valid kerberos ticket. Following error showing up kafka logs file. Can you please point what was missing here.

props.put("serializer.class", "kafka.serializer.StringEncoder")
props.put("metadata.broker.list", brokerList)
props.put("security.protocol", "PLAINTEXTSASL")
private val config = new ProducerConfig(props)

producer.send(

KeyedMessage[String, String](topicName, java.util.UUID.randomUUID().toString, null, record)

)

kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries. at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:91) at kafka.producer.Producer.send(Producer.scala:77) at com.naresh.org.utils.KafkaHandler.send(KafkaHandler.scala:45) at com.naresh.org.utils.KafkaHandler.publish(KafkaHandler.scala:55) at com.naresh.org.logs_analyzer.loggenerator.ApacheLogGeneratorKafka.LogGenerator(ApacheLogGeneratorKafka.scala:248) at com.naresh.org.logs_analyzer.loggenerator.ApacheLogGeneratorKafka$.main(ApacheLogGeneratorKafka.scala:44) at com.naresh.org.logs_analyzer.loggenerator.ApacheLogGeneratorKafka.main(ApacheLogGeneratorKafka.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at scala.tools.nsc.util.ScalaClassLoader$anonfun$run$1.apply(ScalaClassLoader.scala:71) at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:139) at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:71) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:139) at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:28) at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:45) at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:35) at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:45) at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74) at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96) at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:105) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

1 REPLY 1
Highlighted

Re: Producer not able to submit the messages to kafka in kerberos enabled cluster.

Explorer

You can try with console producer. This way we can verify the kerberos setup

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.2/bk_secure-kafka-ambari/content/ch_secure-ka...

Don't have an account?
Coming from Hortonworks? Activate your account here