2016-03-03 27 views
6

我的kafka版本是0.9.0.1,我有兩個經紀人:192.168.1.100和192.168.1.101,它們使用ssl進行身份驗證和加密。如何使用kafka acls?

我有一個名爲test09和客戶端IP的話題是192.168.1.102

當我用命令行界面這樣添加ACL:

bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --deny-principal User:* --deny-host 192.168.1.102 --operation Read --topic test09 

從192.168.1.102消費者仍然可以得到數據。

有人能告訴我如何在卡夫卡使用ACL嗎?

回答

10

我相信你已經錯過了在Server.properties

authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer 

添加下面的屬性 - 添加此行將使ACL通過SimpleAclAuthorizer工作。 - 默認情況下,卡夫卡自帶參數authorizer.class.name定義的kafka.security.auth.SimpleAclAuthorizer

你可以嘗試下面的設置,可能會給出完整的想法。

https://github.com/Symantec/kafka-security-0.9

+0

它的工作原理!謝謝。 – LiGa

相關問題