赞
踩
kafka_2.12-2.4.0.tgz(带zookeeper)
tar zxvf kafka_2.12-2.4.0.tgz -C /data
mv kafka_2.12-2.4.0 kafka
vim /data/kafka/config/server.properties:
############################# Server Basics #############################
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0
host.name=10.7.2.201
listeners=SASL_PLAINTEXT://10.7.2.201:9092
advertised.listeners=SASL_PLAINTEXT://10.7.2.201:9092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.enabled.mechanisms=PLAIN
sasl.mechanism.inter.broker.protocol=PLAIN
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true
在kafka安装目录下创建一个 kafka_server_jaas.conf 文件
vim /data/kafka/kafka_server_jaas.conf:
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="admin"
password="adminpasswd"
user_admin="adminpasswd"
user_producer="producerpwd"
user_consumer="consumerpwd";
};
说明:该配置通过org.apache.org.apache.kafka.common.security.plain.PlainLoginModule由指定采用PLAIN机制,定义了用户。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。