Steps to use security enabled kafka

Steps to use kerberos security enabled kafka are below.


  1. Set Inter Broker Protocol SASL_PLAINTEXT in Cloudera manager
  2. Create a jaas.conf file with the following contents to use with cached Kerberos credentials

For kinit

KafkaClient { required



For keytab


KafkaClient { required





In the above jaas.conf file the user’s principal and keytab should be used.

3. Create the file containing the following properties.



4. Create and list a topic


kafka-topics –create –zookeeper  –replication-factor 4 –partitions 4 –topic anoop4

kafka-topics –list –zookeeper

5. Set the environment to use jaas.conf

#export KAFKA_OPTS=””


6. Start the producer

#kafka-console-producer –broker-list –topic anoop4 –producer.config

7. Start the consumer and check the messages are received at consumer side

#kafka-console-consumer –new-consumer –topic anoop4 –from-beginning –bootstrap-server –consumer.config


One thought on “Steps to use security enabled kafka

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s