简体   繁体   中英

How to enable SASL mechanism in kafka locally

How to enable SASL mechanism with JAAS Authentication for kafka? thus the consumer/producer have to provide username & password in order to be able to publish in the broker在此处输入图像描述

The process of enabling SASL authentication in Kafka is extensively described in the Authentication using SASL section in the documentation. I suggest you follow the official documentation as it contains instructions for all the mechanisms and recommendations for production environments.

To give a bit of background, at a glance you need to:

  1. Create a JAAS file for brokers with a KafkaServer block and the configuration for the specific mechanism.

  2. Add -Djava.security.auth.login.config=<PATH_TO_JAAS_FILE> to your broker JVM command line argument.

  3. Configure client to use SASL via the security.protocol , sasl.mechanism and sasl.jaas.config settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM