kafka学习笔记八kafka的权限管理之ACL权限控制

kafka的权限管理之ACL权限控制

1.broker acl configuration

2.producer acl write

3.consumer acl read

4.programming acl (consumer & producer)

 

一、配置 broker sasl(acl) configuration
1.1 分别复制server.properties为sasl-server.properties,修改sasl-server.properties增加如下配置

advertised.listeners=PLAINTEXT://120.26.198.248:9092,SASL_PLAINTEXT://120.26.198.248:9093

authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
security.inter.broker.protocol= SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
super.users=User:admin

1.2分别在config下创建文件kafka_cluster_jaas.conf

配置如下

kafkaServer{
        org.apache.kafka.common.security.plain.PlainLoginModule required
        username="admin"
        password="admin"
        user_admin="admin"
        user_reader="reader"
        user_writer="writer";
};

1.3分别修改启动脚本

bin/kafka-server-start.sh

exec $base_dir/kafka-run-class.sh $EXTRA_ARGS -Djava.security.auth.login.config=/usr/local/kafka/kafka_2.11-0.11.0.1/config/kafka_cl
uster_jaas.conf  kafka.Kafka "$@"

1.4启动kafka服务

[root@iZbp1c8mn5lner8nhvreblZ kafka_2.11-0.11.0.1]# bin/kafka-server-start.sh -daemon config/sasl-server.properties 

二、kafka ACL命令

2.1  查看topic的权限信息

[root@iZbp14ouog5ocoeakj39prZ kafka_2.11-0.11.0.1]# bin/kafka-acls.sh --list --authorizer-properties zookeeper.connect=10.174.32.122:2181,10.117.15.224:2181,10.168.96.248:9092
[2018-08-29 11:32:52,490] WARN Client session timed out, have not heard from server in 2011ms for sessionid 0x0 (org.apache.z
  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值