Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Publish Kafka Error --- Time out

Publish Kafka Error --- Time out

New Contributor

Hello,

We have already done with the configuration for Publishkafka_0_10 kerberized kafka for DEV server. The configuration we done are as follows:

1. relnm entry in krb5.conf.

2. Done with kinit using keytab file and principal/ checked with klist.

3.change in nifi_jaas.conf.

4. added entry for jaas in bootstrap.conf file.

with above configuration we were able to send messages in DEV kafka server topics.

Now, we want to point the same to PROD server, so we have made same changes to point it to PROD from the same source server. checked telnet with the KDC port (88) , kafka broker port (6667) and zookeeper port (2181). changed relnm.

But still we are facing time out error.

kindly help.

Thanks,

Gitanjali

5 REPLIES 5

Re: Publish Kafka Error --- Time out

Rising Star

Hi @Gitanjali Bare,

Could you please share the complete error you are getting?

Thanks!

Re: Publish Kafka Error --- Time out

New Contributor

@Gitanjali Bare Check if kafka broker port is blocked to outside world or any firewall blocking traffic.

Highlighted

Re: Publish Kafka Error --- Time out

Contributor
@Gitanjali Bare

Even i have faced the timeout error. There are two ways to solve this error:

1) Validate the KDC port 88 is allowed to ESTABLISH for both TCP and UDP connections.

netstat -an | grep 88

2) If the UDP is not allowed to used, add the following entry in krb5.conf under [libdefaults]

udp_preference_limit = 1

This worked for me . Hope this will help you also.

Thanks...

Re: Publish Kafka Error --- Time out

New Contributor

@dbains

please find logs in detail:

Exception in thread "main" org.apache.kafka.common.KafkaException: Failed to construct kafka producer at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:335) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:188) at com.ril.fnl.kafka.producer.service.BasicProducerExample.main(BasicProducerExample.java:30) Caused by: org.apache.kafka.common.KafkaException: javax.security.auth.login.LoginException: Receive timed out at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:86) at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:70) at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:83) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:277) ... 2 more Caused by: javax.security.auth.login.LoginException: Receive timed out at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:808) at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:617) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) at javax.security.auth.login.LoginContext.login(LoginContext.java:587) at org.apache.kafka.common.security.authenticator.AbstractLogin.login(AbstractLogin.java:69) at org.apache.kafka.common.security.kerberos.KerberosLogin.login(KerberosLogin.java:110) at org.apache.kafka.common.security.authenticator.LoginManager.<init>(LoginManager.java:46) at org.apache.kafka.common.security.authenticator.LoginManager.acquireLoginManager(LoginManager.java:68) at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:78) ... 5 more Caused by: java.net.SocketTimeoutException: Receive timed out at java.net.PlainDatagramSocketImpl.receive0(Native Method) at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143) at java.net.DatagramSocket.receive(DatagramSocket.java:812) at sun.security.krb5.internal.UDPClient.receive(NetClient.java:206) at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:411) at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:364) at java.security.AccessController.doPrivileged(Native Method) at sun.security.krb5.KdcComm.send(KdcComm.java:348) at sun.security.krb5.KdcComm.sendIfPossible(KdcComm.java:253) at sun.security.krb5.KdcComm.send(KdcComm.java:229) at sun.security.krb5.KdcComm.send(KdcComm.java:200) at sun.security.krb5.KrbAsReqBuilder.send(KrbAsReqBuilder.java:316) at sun.security.krb5.KrbAsReqBuilder.action(KrbAsReqBuilder.java:361) at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:776) ... 22 more

Re: Publish Kafka Error --- Time out

New Contributor

@Rohit Sharma

Thanks for the reply.

I have followed same steps.

It also worked for me.

Its Either way, the UDP connections should open for KDC port OR add "udp_preference_limit =1" in krb5.conf file.