kafka快速開始

不要亂摸發表於2018-02-09

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

 

相關文章