How to find kafka broker username and password - Stack Overflow
I'm using Kafka 3.0.0 and following a tutorial to run this command:
kafka-topics.sh --command-config playground.config --bootstrap-server localhost:9092 --topic first_topic --create --partitions 5 --replication-factor 1
but get the following error:
[2025-01-04 14:09:04,953] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (localhost./127.0.1.1:9092) terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue. (org.apache.kafka.clients.NetworkClient)
The playground config has the following settings:
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafkamon.security.plain.PlainLoginModule required username="username" password="password"
I read that the username and password is defined in the jaas.conf file, but I can't seem to find that file. I checked in the following locations:
- /etc/kafka/
- /opt/kafka/config/
- /usr/local/kafka/config/
So my question is do I need to provide a username and password? The server.properties doesn't explicitly define that SASL has to be used.
I'm using Kafka 3.0.0 and following a tutorial to run this command:
kafka-topics.sh --command-config playground.config --bootstrap-server localhost:9092 --topic first_topic --create --partitions 5 --replication-factor 1
but get the following error:
[2025-01-04 14:09:04,953] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (localhost./127.0.1.1:9092) terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue. (org.apache.kafka.clients.NetworkClient)
The playground config has the following settings:
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="username" password="password"
I read that the username and password is defined in the jaas.conf file, but I can't seem to find that file. I checked in the following locations:
- /etc/kafka/
- /opt/kafka/config/
- /usr/local/kafka/config/
So my question is do I need to provide a username and password? The server.properties doesn't explicitly define that SASL has to be used.
Share Improve this question asked 22 hours ago rds80rds80 6292 gold badges11 silver badges30 bronze badges1 Answer
Reset to default 0Your last line of explanations turns few technical doubts but how it works is the following:
These credentials are typically required when SASL authentication is enabled in the Kafka broker.If SASL is not explicitly configured in the broker's server.properties, username and password may not be necessary.If SASL is enabled, the username and password are usually defined: Directly in the broker configuration (server.properties). In an external file (e.g., jaas.conf).
Places to check:
the server.properties file on the Kafka broker:
listeners=SASL_SSL://:9092 advertised.listeners=SASL_SSL://your-host:9092 security.protocol=SASL_SSL sasl.mechanism.inter.broker.protocol=PLAIN sasl.enabled.mechanisms=PLAIN listener.name.sasl_ssl.plain.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";
The last line of above is listener.name.sasl_ssl.plain.sasl.jaas.config field defines the broker-side authentication credentials.
- If the credentials are not in server.properties, the broker may use an external jaas.conf file
in bash side type: echo $KAFKA_OPTS
, and look for something like -Djava.security.auth.login.config=/path/to/jaas.conf
. Follow the path, and open the file. User/Pass is possible to be here.
- 谷歌继续封死华为后路,Mate 30无法安装谷歌服务
- 安卓上市11年 为何说iPhone用户也要感谢它
- 微信支付和支付宝口水战开打!
- 有事请烧纸!清明祭奠已死的平板电脑
- Gmail SMTP relay with postfix - Stack Overflow
- c++ - Android OpenXR application java.io.FileNotFoundException: apexcom.meta.xrpriv-appVrDriverVrDriver.apk - Stack Overflow
- javascript - Chrome Extension with proxy, onAuthRequired never being triggered - Stack Overflow
- windows 10 - Gamemaker Mobile device Inconsistent Drag Speed Across Different Operating Systems (Win7 vs. Win10) - Stack Overflo
- python - Error with modules aiogram 3.0, how to fix? - Stack Overflow
- Vercel hosted SvelteKit app keeps 404ing on form submit? - Stack Overflow
- bitcoin - Problem with sign PSBT.Error sign transaction - Stack Overflow
- macos - Restriction of media fetched with API in browser in iOS and Mac systems - Stack Overflow
- overlap - Canvas3D obscures JMenuBar - Stack Overflow
- solrcloud - How to use "or" in an eDisMax query in Solr 9.4? - Stack Overflow
- javascript - Firebase Auth link - Problem with the Google login, no possibility to change to own project name - Stack Overflow
- c# - Trouble when setting up Serilog in ASP.NET Core Web API - Stack Overflow
- OneNote with embeded Excel having Data Connection - security warning and disabled - Stack Overflow