Error "AdminOperationException" Is Displayed When a Kafka Topic Is Deleted
Symptom
When running the following command on the Kafka client to set the ACL for a topic, it is found that the ACL cannot be set.
kafka-topics.sh --delete --topic test4 --zookeeper 10.5.144.2:2181/kafka
The error message "ERROR kafka.admin.AdminOperationException: Error while deleting topic test4" is displayed.
Details are as follows:
Error while executing topic command : Error while deleting topic test4 [2017-01-25 14:00:20,750] ERROR kafka.admin.AdminOperationException: Error while deleting topic test4 at kafka.admin.TopicCommand$$anonfun$deleteTopic$1.apply(TopicCommand.scala:177) at kafka.admin.TopicCommand$$anonfun$deleteTopic$1.apply(TopicCommand.scala:162) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) at kafka.admin.TopicCommand$.deleteTopic(TopicCommand.scala:162) at kafka.admin.TopicCommand$.main(TopicCommand.scala:68) at kafka.admin.TopicCommand.main(TopicCommand.scala) (kafka.admin.TopicCommand$)
Possible Causes
The user does not belong to the kafkaadmin group. Kafka provides a secure access interface. Only users in the kafkaadmin group can delete topics.
Cause Analysis
- After the client command is run, the "AdminOperationException" exception is reported.
- Run the client command klist to query the current authenticated user.
[root@10-10-144-2 client]# klist Ticket cache: FILE:/tmp/krb5cc_0 Default principal: test@HADOOP.COM Valid starting Expires Service principal 01/25/17 11:06:48 01/26/17 11:06:45 krbtgt/HADOOP.COM@HADOOP.COM
The test user is used in this example.
- Run the id command to query the user group information.
[root@10-10-144-2 client]# id test uid=20032(test) gid=10001(hadoop) groups=10001(hadoop),9998(ficommon),10003(kafka)
Solution
MRS Manager:
- Log in to MRS Manager.
- Choose System > Manage User.
- In the Operation column of the user, click Modify.
- Add the user to the kafkaadmin group. Click OK.
Figure 1 Modifying user information
- Run the id command to query the user group information.
[root@10-10-144-2 client]# id test uid=20032(test) gid=10001(hadoop) groups=10001(hadoop),9998(ficommon),10002(kafkaadmin),10003(kafka)
FusionInsight Manager:
- Log in to FusionInsight Manager.
- Choose System > Permission > User.
- Locate the row that contains the target user, and click Modify.
- Add the user to the kafkaadmin group. Click OK.
- Run the id command to query the user group information.
[root@10-10-144-2 client]# id test uid=20032(test) gid=10001(hadoop) groups=10001(hadoop),9998(ficommon),10002(kafkaadmin),10003(kafka)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot