[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