美文网首页
kafka密码配置

kafka密码配置

作者: 于殿国 | 来源:发表于2019-05-21 11:48 被阅读0次
    th?id=OHR.CRDelta_ZH-CN5088201492_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp.jpg

    1、在 consumer.properties 、producer.properties 底部添加配置、

    security.protocol=SASL_PLAINTEXT
    sasl.mechanism=PLAIN
    

    2、在 server.properties 文件中添加

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

    3、启动配置修改 kafka-server-start.sh

    export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/kafka_2.12-2.1.1/config/kafka_server_jaas.conf"
    

    4、zookper启动文件修改 zookeeper-server-start.sh

    export KAFKA_OPTS=" -Djava.security.auth.login.config=/opt/kafka_2.12-2.1.1/config/kafka_zoo_jaas.conf”
    

    5、添加新文件 kafka_server_jaas.conf

    KafkaServer {
         org.apache.kafka.common.security.plain.PlainLoginModule required
         username="admin"
         password="ao123456c"
         user_admin="ao123456c"
         user_alice="Q3123456P";
     };
    
    
    KafkaClient {
        org.apache.kafka.common.security.plain.PlainLoginModule required
        username="admin"
        password="ao123456c";
     };
    

    6、添加新文件 kafka_zoo_jaas.conf

    zookeeper {
      org.apache.kafka.common.security.plain.PlainLoginModule required
      username="alice"
      password="Q3123456P";
    };
    

    https://stackoverflow.com/questions/49773806/docker-compose-wurstmeister-kafka-failing-to-parse-kafka-opts

    https://blog.csdn.net/u012040869/article/details/82589002

    相关文章

      网友评论

          本文标题:kafka密码配置

          本文链接:https://www.haomeiwen.com/subject/pqidzqtx.html