You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by goutham krishna Teja <go...@gmail.com> on 2019/05/10 21:13:43 UTC
org.apache.kafka.common.errors.TimeoutException: Failed to update
metadata after 60000 ms after enabling SASL PLAINTEXT authentication
Hi All,
I'm running into time out exception when i try to run producer and consumer
through java or console.
*kafka server.properties*
advertised.host.name=127.0.0.1
listeners=SASL_PLAINTEXT://127.0.0.1:9090
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
advertised.listeners=SASL_PLAINTEXT://127.0.0.1:9090
*kafka server jass conf*
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="admin"
password="admin"
user_admin="admin"
user_test="test";
};
*client producer/consumer properties *
String jaasTemplate =
"org.apache.kafka.common.security.plain.PlainLoginModule required
username=\"%s\" password=\"%s\";";
String jaasCfg = String.format(jaasTemplate, "test", "test");
brokers.delete(brokers.length() - 1, brokers.length());
properties.put("bootstrap.servers", brokers.toString());
properties.put("retry.backoff.ms", "1000");
properties.put("reconnect.backoff.ms", "1000");
properties.put("max.request.size", "5242880");
properties.put("key.serializer",
"org.apache.kafka.common.serialization.ByteArraySerializer");
properties.put("value.serializer",
"org.apache.kafka.common.serialization.ByteArraySerializer");
// properties.put("metadata.max.age.ms", 15000); //Refresh topic
partition leadership every 15 seconds
properties.put("sasl.jaas.config", jaasCfg);
properties.put("security.protocol", "SASL_PLAINTEXT");
properties.put("sasl.mechanism", "PLAIN");
properties.put("ssl.client.auth", "none");
Also added env variable for KAKFA_OPTS with jass config location so
console consumer can use that login module.
i am running single node kafka (0.10.2) with zookeeper (3.4.9). with
these setting both broker and zookeeper comes up.
But clients with valid credential not able to write/read from the broker.
pretty much used steps in documentation from apache Kafka.
Pls advice?
Thanks,
Goutham