Java.net.UnknownHostException error occurred while executing consumer

Source: Internet
Author: User

"Time":

2016/4/8 17:30

"Problem":

Kafka An error occurred while executing the consumer instance.

The Kafka configuration file Server.properties is as follows:

Zookeeper configuration file Zoo.cfg content is as follows:

The implementation code for consumer is as follows:

Where the static class is defined as follows:

The common approach is implemented as follows:

"Survey":

(1) Look at the Linux firewall settings service iptables status, found not closed. However, the problem persists after closing.

• Immediate effect, fail after reboot

Open: Service iptables start

Close: Service iptables stop

• Effective after reboot

Open: Chkconfig iptables on

OFF: Chkconfig iptables off

(2) Look at the salary status of the cluster.

Confirm that the zookeeper has started normally.

Confirm that the Kafka cluster has started normally.

(3) The final discovery is caused by the existence of half-width spaces in the definition of constants.

Correct: "192.168.93.128:2181,192.168.93.129:2181,192.168.93.130:2181";

Error: "192.168.93.128:2181, 192.168.93.129:2181, 192.168.93.130:2181";

The result of the modification is as follows:

" normal operation of consumer instances":

--end--

Java.net.UnknownHostException error occurred while executing consumer

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.