Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 10-07-2024 10:12 PM
Hello:
How to use HAProxy to connect for Kafka with Kerberos authentication?
I have three kafka brokers, and i try to use haproxy in front of kafka, but kerberos authenticated failed
My haproxy.conf
listen kafka
bind *:6677
mode tcp
balance roundrobin
server kafka1 kafka-1.kafka.net:6668 check
server kafka2 kafka-2.kafka.net:6669 check
server kafka3 kafka-3.kafka.net:6666 check
I also modified
kafka1 server.properties
kafka2 server.properties
kafka3 server.properties
amd use the command
/usr/hdp/current/kafka-broker/bin/kafka-console-producer.sh --topic my-topic --broker-list gateway.kafka.net:6677 --producer-property security.protocol=SASL_PLAINTEXT
Will get the error:
[2024-10-08 20:07:58,330] ERROR [Producer clientId=console-producer] Connection to node -1 failed authentication due to: Authentication failed due to invalid credentials with SASL mechanism GSSAPI (org.apache.kafka.clients.NetworkClient)
[2024-10-08 20:07:58,330] ERROR Error when sending message to topic my-topic5 with key: null, value: 0 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
Created 12-22-2024 05:33 AM
@polingsky202
To configure HAProxy to connect three Kafka brokers with Kerberos authentication and resolve the Authentication failed due to invalid credentials with SASL mechanism GSSAPI error, follow these steps:
The provided configuration shows:
Issue Likely Causes:
Update the HAProxy configuration to correctly pass Kerberos authentication to Kafka brokers.
Ensure the Kerberos configuration for each broker is consistent and properly aligned.
advertised.listeners:
Kerberos JAAS Configuration:
Repeat similar updates for kafka2 and kafka3 with their respective listener ports.
Ensure that Kerberos configuration is consistent across all systems.
Validate Kerberos krb5.conf ensure the file includes the correct realm and KDC information:
[libdefaults]
default_realm = KAFKA.NET
[realms]
KAFKA.NET = {
kdc = your-kdc-host
admin_server = your-kdc-admin-host
}
The client is attempting to authenticate with Kerberos. Ensure the producer properties are configured correctly updated Producer Command: see below
Enable Debug Logging: Add -Dsun.security.krb5.debug=true to the JVM options for the client to debug Kerberos issues
Check Logs:
With these adjustments, the Kerberos authentication error should be resolved. Let me know if further clarification is needed!
Happy hadooping
Created on 01-23-2025 09:15 AM - edited 01-23-2025 09:16 AM
Hello