[root@xupan001 ~]# kafka-topics.sh -zookeeper xupan001:2181,xupan002:2181,xupan003:2181 --describe --topic test001
Topic: test001 PartitionCount:3 ReplicationFactor:3 Configs:
Topic: test001 Partition: 0 Leader: 2 Replicas: 2,0,1 Isr: 2,0,1 副本集合【Replicas: 2,0,1】【Isr: 2,0,1數據同步2》0》1】
Topic: test001 Partition: 1 Leader: 0 Replicas: 0,1,2 Isr: 0,1,2
Topic: test001 Partition: 2 Leader: 1 Replicas: 1,2,0 Isr: 1,2,0進程
Kafka進程沒有主從,Partition是有主從的(leaderfener負責讀寫數據,follower負責同步數據)kafka
partiton: partion id,因爲此處只有3個partition,所以partition id 爲0,1,2
leader:當前負責讀寫的lead broker id
relicas:當前partition的全部replication broker list
isr:relicas的子集,只包含出於活動狀態的broker同步
分區以及同步過程以下:it