을 = 모든 다음 메시지가 최선을 다하고되지 않고 소비자 후에도, 그 메시지를받을 수 없습니다 충돌 한 복제본이 다시 돌아오고 ISR 목록에 다시 추가됩니다. 다음과 같은 방법으로 테스트 할 수 있습니다. min.insync.replicas = 2
$ ./bin/kafka-server-start.sh ./config/server-1.properties
$ ./bin/kafka-server-start.sh ./config/server-2.properties
와
시작이 브로커는 1 개 파티션 및 RF = 2 항목을 만듭니다. 두 브로커가 모두 ISR 목록에 있는지 확인하십시오.
$ ./bin/kafka-topics.sh --zookeeper zookeeper-1 --create --topic topic1 --partitions 1 --replication-factor 2
Created topic "topic1".
$ ./bin/kafka-topics.sh --zookeeper zookeeper-1 --describe --topic topic1
Topic:topic1 PartitionCount:1 ReplicationFactor:2 Configs:
Topic: topic1 Partition: 0 Leader: 1 Replicas: 1,2 Isr: 1,2
콘솔 소비자 및 콘솔 생산자를 실행하십시오. 생산품에 ack = -1을 사용하는지 확인하십시오.
$ ./bin/kafka-console-consumer.sh --new-consumer --bootstrap-server kafka-1:9092,kafka-2:9092 --topic topic1
$ ./bin/kafka-console-producer.sh --broker-list kafka-1:9092,kafka-2:9092 --topic topic1 --request-required-acks -1
메시지를 생성하십시오. 소비자는 그것을 받아야한다.
중개인 중 한 명을 죽이십시오 (id = 2 인 브로커를 죽였습니다). ISR 목록이 하나의 브로커로 축소되었는지 확인하십시오.
$ ./bin/kafka-topics.sh --zookeeper zookeeper-1 --describe --topic topic1
Topic:topic1 PartitionCount:1 ReplicationFactor:2 Configs:
Topic: topic1 Partition: 0 Leader: 1 Replicas: 1,2 Isr: 1
다시 작성하십시오. 생산자에서 일부
Error: NOT_ENOUGH_REPLICAS
(하나 당 재시도)를 취득해야하며, 마지막으로
Messages are rejected since there are fewer in-sync replicas than required.
소비자는 이러한 메시지를받을 수 없습니다.
죽인 브로커를 다시 시작하고 다시 생성하십시오. 소비자는이 메시지를 수신하지만 복제본 중 하나가 다운 된 동안 보낸 메시지는 수신하지 않습니다.
브로커가 생산자와 동일한 것을 인정하지 않았음에도 메시지가 궁극적으로 소비자에게 전달됩니다. – Vikk
이 경우 예. –