`
sillycat
  • 浏览: 2553016 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Kafka(5)Upgrade the Version with Multiple Machine

 
阅读更多

Kafka(5)Upgrade the Version with Multiple Machine

1. Run Single Broker on Single Node
Download the latest version of codes
http://psg.mtu.edu/pub/apache/kafka/0.8.1.1/kafka-0.8.1.1-src.tgz

Unzip the codes and build it.
>./gradlew -PscalaVersion=2.10.0 releaseTarGz -x signArchives

Find the binary file from here
kafka-0.8.1.1/core/build/distributions

Unzip the file and place it in working directory.

Check and change the conf/server.properties

Before we start the kafka, start the zookeeper first
>zkServer.sh start conf/zoo-cluster.cfg

Start the kafka broker
>bin/kafka-server-start.sh config/server.properties

Create the topic
>bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic console-test

Open the sample producer
>bin/kafka-console-producer.sh --broker-list localhost:9092 --topic console-test

2. Run multiple Brokers on Single Machine
Copy and change 

config/server1.properties
broker.id=1
port=9092
log.dirs=/tmp/kafka-logs1

config/server2.properties
broker.id=2
port=9093
log.dirs=/tmp/kafka-logs2

Start the 2 servers
>bin/kafka-server-start.sh config/server1.properties
>bin/kafka-server-start.sh config/server2.properties

Create a Topic on the Cluster
>/opt/kafka$ bin/kafka-topics.sh --create --zookeeper ubuntu-client1:2181,ubuntu-client2:2181,ubuntu-client3:2181 --replication-factor 2 --partitions 2 --topic cluster1

Open the producer Console
>bin/kafka-console-producer.sh --broker-list ubuntu-client1:9092,ubuntu-client1:9093 --topic cluster1

Open the consumer Console to display the message
>bin/kafka-console-consumer.sh --zookeeper ubuntu-client1:2181,ubuntu-client2:2181,ubuntu-client3:2181 --topic cluster1 --from-beginning

3. Run multiple brokers on multiple machines
broker id should be unique, port number should be different on the same machine, so the log dir. That is it.


Create the topic
>bin/kafka-topics.sh --create --zookeeper ubuntu-client1:2181,ubuntu-client2:2181,ubuntu-client3:2181 --replication-factor 2 --partitions 2 --topic cluster2

Producer
>bin/kafka-console-producer.sh --broker-list ubuntu-client1:9092,ubuntu-client2:9092,ubuntu-client3:9092 --topic cluster2

Consumer
>bin/kafka-console-consumer.sh --zookeeper ubuntu-client1:2181,ubuntu-client2:2181,ubuntu-client3:2181 --topic cluster2 --from-beginning



References:
http://www.iteblog.com/archives/1044
http://www.iteblog.com/archives/1045
http://www.iteblog.com/archives/1049

分享到:
评论

相关推荐

    Kafka the Definitive Guide 2nd Edition

    Kafka the Definitive Guide Kafka 是一个分布式流媒体平台,用于构建实时数据处理和流媒体处理系统。下面是 Kafka 的一些重要知识点: 1. Kafka 概述 Kafka 是一个基于发布/订阅模式的消息队列系统,由 LinkedIn...

    kafka-manager最新编译版1.3.3.22,解决了异常Unknown offset schema version 3

    《Kafka-Manager 1.3.3.22:解决Unknown offset schema version 3异常详解》 在大数据处理领域,Apache Kafka作为一个高效、可扩展的实时数据流平台,广泛应用于消息传递和数据集成。然而,在实际操作中,用户可能...

    kafkatool_64bit_v1.0.3.exe.zip

    All versions of Kafka Tool come with a bundled JRE with the exception of the Linux version. For Linux, you must have Java 8 installed on your operating system before using Kafka Tool. After ...

    Building Data Streaming Applications with Apache Kafka

    Apache Kafka is a popular ...By the end of this book, you will have all the information you need to be comfortable with using Apache Kafka and to design efficient streaming data applications with it.

    Kafka_The Definitive Guide_Real-Time Data and Stream Processing at Scale-2017

    The greatest compliment you can give an author of a technical book is “This is the book I wish I had when I got started with this subject.” This is the goal we set for our‐ selves when we started ...

    Kafka_The Definitive Guide_Real-Time Data and Stream Processing at Scale

    本书《Kafka: The Definitive Guide》由Neha Narkhede、Gwen Shapira和Todd Palino编写,由O'Reilly Media出版社出版,首次发行于2017年9月。这本书为Apache Kafka的初学者以及希望深入了解和利用Kafka的中级用户...

    kafkatool 连接kafka工具

    **Kafka Tool 连接 Kafka 工具详解** 在大数据处理和实时流处理领域,Apache Kafka 是一个不可或缺的组件,它作为一个分布式的消息中间件,提供高效、可扩展且可靠的发布订阅服务。为了方便管理和操作 Kafka 集群,...

    Learning Apache Kafka, 2nd Edition

    Learning Apache Kafka Second Edition provides you with step-by-step, practical examples that help you take advantage of the real power of Kafka and handle hundreds of megabytes of messages per second ...

    Kafka Streams in Action (MEAP V9)

    Using real-world examples based on the most common uses of distributed processing you'll learn to transform and collect data, work with multiple processors, aggregate data, and more. This book also ...

    ZY_Kafka-0.0.1-jar-with-dependencie

    ZY_Kafka-0.0.1-jar-with-dependencie

    kafka the definitive guide

    book I wish I had when I got started with this subject.” This is the goal we set for ourselves when we started writing this book. We looked back at our experience writing Kafka, running Kafka in ...

    Building Data Streaming Applications with Apache Kafka azw3

    Building Data Streaming Applications with Apache Kafka 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Packt.Learning.Apache.Kafka.2nd.Edition

    Chapter 1, Introducing Kafka, discusses how organizations are realizing the real value of data and evolving the mechanism of collecting and processing it. It also describes how to install and build ...

Global site tag (gtag.js) - Google Analytics