Kafka Failed to send messages after 3 tries error resolution

Source: Internet
Author: User
Tags zookeeper


Once the Kafka deployment is complete, the Kafka and zookeeper are deployed on the same machine because it is a single-unit deployment test.

Once deployed, you can use the command line to test producers and consumers,

However, when accessing using the Java API, it is always impossible to connect,

And the following error is indicated:

kafka.common.FailedToSendMessageException:Failed to send messages after 3 tries.

Toss for a long time, the original is because the connection when the host can not find the cause of

Workaround:

Modify the Kafka configuration file server.properties

Set the appropriate host IP 192.168.1.114 configuration as follows:

zookeeper.connect=192.168.1.114:2181
advertised.listeners=plaintext://192.168.1.114:9092


Once setup is complete, restart Kafka to connect.


Note:

There is also a problem, is the Java API to Kafka connection when stuck, also this problem, through the above configuration of IP, can not only solve the problem of stuck, may connect Kafka






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.