Ambari introducing Kafka Services and conducting basic testing

Source: Internet
Author: User
Tags zookeeper

1, open Ambari home, such as: http://ip:8080/, the default account and password are admin, to login.

2. Click on the action in the lower left corner, add service, and tick Kafka, as shown below


3. Follow the next step to add the IP address of several work nodes, then download and install, wait for the installation, select service Actions--->start start


4, after the start, you can push the message to Kafka, push the message is on different machines on the push, there is a push exception.

[2017-08-22 15:04:34,018] ERROR support. Loggingproducerlistener:exception thrown when sending a message with key= ' 3 ' and payload= ' {"id": "3", "Data": "Hello World" "} ' to topic Topic_test,


Name Description Valid values
Listeners Listener list (comma separated by a different
Agreements (such as PLAINTEXT,TRACE,SSL,
different IP and ports), hostname
If set to 0.0.0.0, the binding is
Some network card address; if hostname
Empty to bind the default NIC.
If
Without configuration, the default is
java.net
. InetAddress
. Getcanonicalhostname ()
such as: plaintext:
Myhost
9092,
trace://:
9091
or plaintext:
0.0.0.0
: 9092,




The final row is identified by the Kafka's listeners default setting of localhost, which causes other hosts to access the broker's IP unreachable, the workaround is to set their own ip:port or hostname for each installation Kafaka node: port.

As shown in the following figure.


5, through the command to subscribe to the data channel Topic_test, you can receive data, the subscription command is as follows:

./kafka-console-consumer.sh--topic topic_test--zookeeper ip:2181--from-beginning

View the list of all topic commands as follows:

./kafka-topics.sh--list--zookeeper ip:2181

6, because the message structure of the push theme channel changed, consumer consumer clients can not receive the message pushed to the channel when they subscribe to the theme channel, view the group's settings is unique, and then delete

Zookeeper all topic, restart the connection Kafka push and subscribe, subscribe to the subject channel's data reception to return to normal. The command to delete zookeeper is as follows:

Zookeeper-client

Note: It is doubtful whether the problem is groupid, but because each partition of Kafka Borker can only be subscribed by one consumer of the same group, but also because the Borker partition number of Pation.num is not modified, Kafka default number of partitions is 1




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.