kafka快速开始

Step 1: Download the code

Step 2: Start the server

Step 3: Create a topic

Step 4: Send some messages

Step 5: Start a consumer

Step 6: Setting up a multi-broker cluster

分别配置如下

  • "leader"  这个节点负责指定分区的所有读和写操作
  • "replicas"  复制这个分区日志的结点列表,不管是不是leader都算在内
  • "isr"  同步副本的集合,它是当前活着的副本列表的子集 

接下来,发个消息试试

消息是发布到localhost:9092上的,而当连接到localhost:9093和localhost:9094上也能收到消息,由此可见,replication-factor=3的作用

 

参考  http://kafka.apache.org/quickstart

 

posted @ 2018-02-09 17:23  废物大师兄  阅读(934)  评论(0编辑  收藏  举报