简体   繁体   English

为kafka主题配置ACL

[英]Configuring ACL for kafka topic

I have a unsecured kafka instance with 2 brokers everything was running fine until I decided to configure ACL for topics, after ACL configuration my consumers stopped polling data from Kafka and I keep getting warning Error while fetching metadata with correlation id , my broker properties looks like below:- 我有一个不安全的kafka实例,有2个代理,一切运行正常,直到我决定为主题配置ACL,在ACL配置后,我的消费者停止从Kafka轮询数据,并且在获取具有相关ID的元数据时不断收到警告错误 ,我的代理属性看起来像下面:-

listeners=PLAINTEXT://localhost:9092
advertised.listeners=PLAINTEXT://localhost:9092
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true

And my client configuration looks like below:- 我的客户端配置如下所示: -

bootstrap.servers=localhost:9092
topic.name=topic-name
group.id=topic-group

I've used below command to configure ACL 我用下面的命令来配置ACL

bin\windows\kafka-acls.bat  --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:* Read --allow-host localhost  --consumer --topic topic-name --group topic-group

After having all above configuration when I start consumer it stopped receiving messages. 在我启动消费者后完成所有上述配置后,它停止接收消息。 Can someone point where I'm mistaking. 有人可以指出我在误解的地方。 Thanks in advance. 提前致谢。

We are using ACLs successfully, but not with PLAINTEXT protocol. 我们成功使用ACL,但没有使用PLAINTEXT协议。 IMHO you shall use SSL protocol and instead of localhost use the real machine name. 恕我直言,您将使用SSL协议,而不是localhost使用真正的机器名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM