kafka的PLAIN加密认证

1、启动zookeeper
./zookeeper-server-start.sh ../config/zookeeper.properties &
2、config文件夹新建文件 kafka_server_jaas.conf
KafkaServer {
    org.apache.kafka.common.security.plain.PlainLoginModule required
    username="admin"
    password="admin"
    user_admin="admin"
    user_read="read";
};
3、修改kafka-server-start.sh在最前面添加
export KAFKA_OPTS=" -Djava.security.auth.login.config=/kafka/config/kafka_server_jaas.conf"
4、修改server.properties添加,修改对应IP和端口  
3.0版本以前:
listeners=SASL_PLAINTEXT://192.168.X.X:9092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
allow.everyone.if.no.acl.found=false
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true
auto.create.topics.enable=true
delete.topic.enable=true
super.users=User:admin

3.0版本以后:
listeners=SASL_PLAINTEXT://192.168.X.X:9092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
allow.everyone.if.no.acl.found=false
authorizer.class.name=kafka.security.authorizer.AclAuthorizer
allow.everyone.if.no.acl.found=true
auto.create.topics.enable=true
delete.topic.enable=true
super.users=User:admin
5、启动kafka
./kafka-server-start.sh ../config/server.properties &

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值