Do you know any command to remove all the available ACLs from Kafka? If you added literal ACLs to Kafka, when you want to remove it you cannot use prefixed or ... (it just doesn't match with the literal ACLs).
Thanks.
Do you know any command to remove all the available ACLs from Kafka? If you added literal ACLs to Kafka, when you want to remove it you cannot use prefixed or ... (it just doesn't match with the literal ACLs).
Thanks.
You can use the --remove
flag of kafka-acl tool, which removes all the acls applied to the topic. Simply loop the command through all the topics.
for each TOPIC in topicList:
./kafka-acls --authorizer kafka.security.auth.SimpleAclAuthorizer \
--authorizer-properties zookeeper.connect=$ZOOKEEPER \
--topic $TOPIC --remove
You can use kafka-acls --bootstrap-server kafka:9092 --remove --topic *
. The --topics
argument accepts wildcards:
--topic <String: topic> topic to which ACLs should be added or
removed. A value of * indicates ACL
should apply to all topics.
The proposed solutions did not work for me, the ACLs were not deleted unless they matched exactly.
My workaround was to use the AdminClient directly:
try (AdminClient adminClient = AdminClient.create(props)) {
adminClient.deleteAcls(
List.of(new AclBindingFilter(ResourcePatternFilter.ANY, AccessControlEntryFilter.ANY)));
}
© 2022 - 2024 — McMap. All rights reserved.