kafka 复制与一致性

2018-06-23  本文已影响24人  july2993

数据复制基于PacificA

对kafka为了吞吐返回客户端的时候不保证数据已经落盘了,所以后面不管怎么复制写多少个副本都不保证数据落盘持久(全部机器一起挂还是可能会丢数据)

Then it will write the new messages to local disk. On Linux, the messages are written to the filesystem cache and there is no guarantee about when they will be written to disk. Kafka does not wait for the data to get persisted to disk—it relies on replication for message durability.

kafka以partition为单位复制数据。
一些关键的配置:

客户端 producer 推数据的时候可以配置acks=all, all表示leader收到后要得到全部in-sync副本的ack才返回客户端成功了。
kafka会维护一个in-sync副本集合,leader会把落后太多的副本从in-sync集合里剔除。

https://cwiki.apache.org/confluence/display/KAFKA/KIP-101+-+Alter+Replication+Protocol+to+use+Leader+Epoch+rather+than+High+Watermark+for+Truncation
https://stackoverflow.com/questions/48825755/how-does-kafka-handle-network-partitions
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Replication
https://cwiki.apache.org/confluence/display/KAFKA/KIP-101+-+Alter+Replication+Protocol+to+use+Leader+Epoch+rather+than+High+Watermark+for+Truncation
https://stackoverflow.com/questions/48825755/how-does-kafka-handle-network-partitions?rq=1

上一篇 下一篇

猜你喜欢

热点阅读