Linux under Install and (single node) configuration boot Kafka

Source: Internet
Author: User
Tags zookeeper

1. Download the latest Kafka from Kafka website, current version is 0.9.0.1


2. After downloading, upload to the Linux server and unzip

Tar-xzf kafka_2.11-0.9.0.1.tgz


3. Modify the Zookeeper server configuration and start

CD Kafka_2.11-0.9.0.1vi config/zookeeper.properties #修改ZooKeeper的数据目录dataDir =/opt/favccxx/db/zookeeper# Configure Host.name and Advertised.host.name as IP addresses to prevent parsing to localhosthost.name=10.0.10.6advertised.host.name= when connecting through a Java client 10.0.10.6# start the zookeeper server./zookeeper-server-start.sh/opt/favccxx/kafka_2.11-0.9.0.1/config/zookeeper.properties


4. Modify the Kafka configuration and start the Kafka server

VI config/server.properties log.dirs=/opt/favccxx/kafka/kafka-logs# start the Kafka server./kafka-server-start.sh/opt/favccxx /kafka_2.11-0.9.0.1/config/server.properties


5. Create and view topic

cd/opt/favccxx/kafka_2.11-0.9.0.1/bin/./kafka-topics.sh--create--zookeeper localhost:2181--replication-factor 1- -partitions 1--topic testcreated topic "Test". #查看刚才的topic./kafka-topics.sh--list--zookeeper localhost:2181test


6. Use the producer to send messages, each line is a separate message

./kafka-console-producer.sh--broker-list localhost:9092--topic Testthis is a messagethis is My mesage


7. Using consumers to receive messages

./kafka-console-consumer.sh--zookeeper localhost:2181--topic Test--from-beginningthis is a messageThis is My me


This article is from the "This person's IT World" blog, be sure to keep this source http://favccxx.blog.51cto.com/2890523/1761663

Linux under Install and (single node) configuration boot Kafka

Related Article

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.