Introduction to kafka, Kafka copy (thirteen)

Kafka replica

copy basic information

1) Kafka copy function to improve data reliability
2) Kafka has 1 default copy, and the production environment generally configures 2 to ensure data reliability. Too many copies will increase disk storage space, increase data transmission on the network, and reduce efficiency 3)
Kafka The intermediate copies are: Leader and Follower. The kafka producer will only send data to the Leader, and then the Follower will find the Leader to synchronize the data.
4) All copies in the Kafka partition are collectively called AR
AR=ISR+OSR
ISR, which means keeping in sync with the Leader A collection of Follower collections. If the Follower does not send a communication request and synchronization data to the Leader for a long time, the Follower will be kicked out of the ISR. The event threshold is set by the replica.lag.time.max.ms parameter, and the default is 30s. After the leader sends a fault, it will Elect a new leader
OSR from the ISR, indicating that when the Follower and the Leader copy are synchronized, too many copies are delayed

Leader election process

In the kafka cluster, there is a broker controller that will be elected as the controller leader. The replication management cluster broker goes online and offline, and the information synchronization work of the controller, such as the distribution of all topic partition copies and leader election, depends on Zookeeper
.
insert image description here

Guess you like

Origin blog.csdn.net/weixin_43205308/article/details/131487556