什么是 apache kafka 中的 kafka 用户 [英] What is kafka user in apache kafka
问题描述
Kafka 用户是否与 kafka 生产者"相同?或者是不同的.我正在搜索关于 kafka 访问控制列表,我们在其中授予用户访问权限.但我很困惑什么是用户.
Kafka user is same as kafka "producer"? Or is it different.I am searching regarding kafka Access Control List in which we give access to user on topic. But i am confused what is user.
推荐答案
在 Kafka 中,ACL 是在 Principals 上定义的.委托人有点类似于用户.
In Kafka, ACLs are defined on Principals. Principal are somewhat analogous to users.
根据文档:
Kafka acls 以Principal P is[允许/拒绝] 来自主机 H 在资源 R 上的操作 O".
Kafka acls are defined in the general format of "Principal P is [Allowed/Denied] Operation O From Host H On Resource R".
主体具有 TYPE:NAME
格式.例如 User:Alice
.
A Principal has the format TYPE:NAME
. For example User:Alice
.
Kafka 根据使用的协议为每个连接创建一个主体(可以通过 principal.builder.class
自定义).
Kafka creates a Principal for each connection (that can be customized via principal.builder.class
) depending on the protocol used.
默认:
- 使用纯文本:所有连接都将具有相同的主体:
User:Anonymous
- 使用 SSL:主体将使用此格式
User:"CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US"
- 使用 SASL:主体是用户名,例如:
User:Alice
例如,在名为 test-topic
的主题上授予 Bob DESCRIBE 和 WRITE 的 ACL:
For example, an ACL granting Bob DESCRIBE and WRITE on topic called test-topic
:
bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:Bob --producer --topic test-topic
这里的producer
只是添加生成消息所需的所有操作的快捷方式:DESCRIBE 和WRITE.请参阅 http://kafka.apache.org/documentation/#security_authz_cli
Here producer
is just a shortcut to add all necessary Operations for producing messages: DESCRIBE and WRITE. See http://kafka.apache.org/documentation/#security_authz_cli
这篇关于什么是 apache kafka 中的 kafka 用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!