Member since
09-28-2015
73
Posts
26
Kudos Received
6
Solutions
03-07-2017
05:05 PM
@yjiang Creating topics with kafka user is a good practice. But If you want to create a topic as a non kafka user in a kerberized environment you need to workaround by following below steps : If you are not using Ranger : 1. Make sure "auto.create.topic.enable = true" 2. Give acl's for the user from which you want to create a topic, for ex : # bin/kafka-acls.sh --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:Bob --producer --topic Test-topic 3. Do a kinit as a user from which you want to create topic. 4. Now try to produce messages to topic as that user : # ./kafka-console-producer.sh --broker-list <hostname-broker>:6667 --topic Test-topic --security-protocol PLAINTEXTSASL If you are using Ranger : Instead of point 2 in above steps you will need to add a policy for the topic in ranger. Allow permissions for that user to produce, create, consume. Restart kafka service. Then follow step 3 and 4 as mentioned above.
... View more