3节点kafka关闭leader后消费不正常,丢失接收不了消息?

news2024/11/28 0:55:44

关键配置: "topic": "__consumer_offsets"的副本数

/opt/kafka/kafka_2.13-3.8.0/config

在初始化搭建的时候,注意修改红色的部分内容:(3个节点)

[root@k1 config]# cat server.properties |grep -v "^$"|grep -v "#"

offsets.topic.replication.factor=3 ##默认是1,改成3

transaction.state.log.replication.factor=3 ##默认是1,改成3

如果上面的参数没改之前就搭建完成了,发现测试不正常,那么可按如下方法修改: 

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --create --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --replication-factor 3 --partitions 3 --topic iom-int-topic

Created topic iom-int-topic.

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --list --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092

__consumer_offsets

iom-int-topic

但发现__consumer_offsetsReplicationFactor还是1

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --describe --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --topic __consumer_offsets

[2024-10-11 11:17:05,275] WARN [AdminClient clientId=adminclient-1] The DescribeTopicPartitions API is not supported, using Metadata API to describe topics. (org.apache.kafka.clients.admin.KafkaAdminClient)

Topic: __consumer_offsets       TopicId: Jlmj5uIBQ0GtlG7K587Ruw PartitionCount: 50      ReplicationFactor: 1    Configs: compression.type=producer,cleanup.policy=compact,segment.bytes=104857600

        Topic: __consumer_offsets       Partition: 0    Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 1    Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 2    Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 3    Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 4    Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 5    Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 6    Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 7    Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 8    Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 9    Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 10   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 11   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 12   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 13   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 14   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 15   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 16   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 17   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 18   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 19   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 20   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 21   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 22   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 23   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 24   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 25   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 26   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 27   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 28   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 29   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 30   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 31   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 32   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 33   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 34   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 35   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 36   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 37   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 38   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 39   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 40   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 41   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 42   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 43   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 44   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 45   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 46   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 47   Leader: 3       Replicas: 3     Isr: 3  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 48   Leader: 1       Replicas: 1     Isr: 1  Elr: N/A        LastKnownElr: N/A

        Topic: __consumer_offsets       Partition: 49   Leader: 2       Replicas: 2     Isr: 2  Elr: N/A        LastKnownElr: N/A

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --describe --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --topic iom-int-topic

[2024-10-11 11:17:17,201] WARN [AdminClient clientId=adminclient-1] The DescribeTopicPartitions API is not supported, using Metadata API to describe topics. (org.apache.kafka.clients.admin.KafkaAdminClient)

Topic: iom-int-topic    TopicId: oar-5HxnQSaOBbYX48rotw PartitionCount: 3       ReplicationFactor: 3    Configs:

        Topic: iom-int-topic    Partition: 0    Leader: 1       Replicas: 1,2,3 Isr: 1,2,3      Elr: N/A        LastKnownElr: N/A

        Topic: iom-int-topic    Partition: 1    Leader: 2       Replicas: 2,3,1 Isr: 2,3,1      Elr: N/A        LastKnownElr: N/A

        Topic: iom-int-topic    Partition: 2    Leader: 3       Replicas: 3,1,2 Isr: 3,1,2      Elr: N/A        LastKnownElr: N/A

[root@k3 ~]# grep factor /opt/kafka/kafka_2.13-3.8.0/config/kraft/server.properties

# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"

offsets.topic.replication.factor=3

transaction.state.log.replication.factor=3

[root@k3 ~]# grep factor /opt/kafka/kafka_2.13-3.8.0/config/server.properties

# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"

offsets.topic.replication.factor=3

transaction.state.log.replication.factor=3

[root@k3 ~]#

使用alter无法修改

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --alter --topic  __consumer_offsets  --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --replication-factor 3 --partitions 50

Option "[replication-factor]" can't be used with option "[alter]"

Option                                   Description                            

------                                   -----------                           

--alter                                  Alter the number of partitions and    

                                           replica assignment. Update the      

                                           configuration of an existing topic  

                                           via --alter is no longer supported  

                                           here (the kafka-configs CLI supports

                                           altering topic configs with a --    

                                           bootstrap-server option).           

--at-min-isr-partitions                  if set when describing topics, only   

                                           show partitions whose isr count is  

                                           equal to the configured minimum.    

--bootstrap-server <String: server to    REQUIRED: The Kafka server to connect 

正确的修改方法:

创建offset.json文件:

[root@k3 ~]# cat offset.json

{

  "topics": [

    {

      "topic": "__consumer_offsets"

    }

  ],

  "version": 1

}

根据offset.json生成分区副本分配策略json文件:

/opt/kafka/kafka_2.13-3.8.0/bin/kafka-reassign-partitions.sh --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --topics-to-move-json-file offset.json --broker-list "1,2,3" –generate

修改replicas和log_dirs并保存上述输出的内容为off.json

[root@k3 ~]# cat off.json

{"version":1,"partitions":[{"topic":"__consumer_offsets","partition":0,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":1,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":2,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":3,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":4,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":5,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":6,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":7,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":8,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":9,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":10,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":11,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":12,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":13,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":14,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":15,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":16,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":17,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":18,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":19,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":20,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":21,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":22,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":23,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":24,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":25,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":26,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":27,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":28,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":29,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":30,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":31,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":32,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":33,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":34,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":35,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":36,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":37,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":38,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":39,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":40,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":41,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":42,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":43,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":44,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":45,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":46,"replicas":[2,3,1],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":47,"replicas":[3,1,2],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":48,"replicas":[1,2,3],"log_dirs":["any","any","any"]},{"topic":"__consumer_offsets","partition":49,"replicas":[2,3,1],"log_dirs":["any","any","any"]}]}

执行修改操作:

[root@k3 ~]# /opt/kafka/kafka_2.13-3.8.0/bin/kafka-reassign-partitions.sh --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --reassignment-json-file off.json --execute

[2024-10-11 12:33:33,956] WARN [AdminClient clientId=reassign-partitions-tool] The DescribeTopicPartitions API is not supported, using Metadata API to describe topics. (org.apache.kafka.clients.admin.KafkaAdminClient)

Current partition replica assignment

{"version":1,"partitions":[{"topic":"__consumer_offsets","partition":0,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":1,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":2,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":3,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":4,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":5,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":6,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":7,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":8,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":9,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":10,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":11,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":12,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":13,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":14,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":15,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":16,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":17,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":18,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":19,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":20,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":21,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":22,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":23,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":24,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":25,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":26,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":27,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":28,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":29,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":30,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":31,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":32,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":33,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":34,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":35,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":36,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":37,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":38,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":39,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":40,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":41,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":42,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":43,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":44,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":45,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":46,"replicas":[2],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":47,"replicas":[3],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":48,"replicas":[1],"log_dirs":["any"]},{"topic":"__consumer_offsets","partition":49,"replicas":[2],"log_dirs":["any"]}]}

Save this to use as the --reassignment-json-file option during rollback

Successfully started partition reassignments for __consumer_offsets-0,__consumer_offsets-1,__consumer_offsets-2,__consumer_offsets-3,__consumer_offsets-4,__consumer_offsets-5,__consumer_offsets-6,__consumer_offsets-7,__consumer_offsets-8,__consumer_offsets-9,__consumer_offsets-10,__consumer_offsets-11,__consumer_offsets-12,__consumer_offsets-13,__consumer_offsets-14,__consumer_offsets-15,__consumer_offsets-16,__consumer_offsets-17,__consumer_offsets-18,__consumer_offsets-19,__consumer_offsets-20,__consumer_offsets-21,__consumer_offsets-22,__consumer_offsets-23,__consumer_offsets-24,__consumer_offsets-25,__consumer_offsets-26,__consumer_offsets-27,__consumer_offsets-28,__consumer_offsets-29,__consumer_offsets-30,__consumer_offsets-31,__consumer_offsets-32,__consumer_offsets-33,__consumer_offsets-34,__consumer_offsets-35,__consumer_offsets-36,__consumer_offsets-37,__consumer_offsets-38,__consumer_offsets-39,__consumer_offsets-40,__consumer_offsets-41,__consumer_offsets-42,__consumer_offsets-43,__consumer_offsets-44,__consumer_offsets-45,__consumer_offsets-46,__consumer_offsets-47,__consumer_offsets-48,__consumer_offsets-49

再次检查:ReplicationFactor变成了3

/opt/kafka/kafka_2.13-3.8.0/bin/kafka-topics.sh --describe --bootstrap-server 192.168.207.131:9092,192.168.207.132:9092,192.168.207.133:9092 --topic iom-int-topic

接下来3个节点宕掉leader后也不会导致消息无法发送接收了。 

相关参考:

必会 | 教你如何重新分布kafka分区、增加分区副本数

解惑 | kafka集群三节点下,挂掉一个节点,为什么消费者消费不到数据了-CSDN博客

kafka原理系列之(三)replication机制(复制原理)和ISR机制(同步机制)_kafka主从复制原理-CSDN博客

Apache Kafka 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2206755.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据结构 -- 跳表

文章目录 概要跳表的结构跳表的查找过程插入操作删除操作补充 概要 跳表&#xff08;Skip List&#xff09;是一种基于链表的数据结构&#xff0c;通过增加多级索引来加速查找、插入和删除操作。它可以看作是链表与二分查找的结合体&#xff0c;能够在保持数据有序的同时&…

使用IMX6UL定时器EPTI实现延时

上一节&#xff0c;我们讲解了如何使用Imx6uL上面的定时器EPTI&#xff0c;这一节我们将使用EPTI进行实战&#xff0c;也就是使用定时器的效果来使用延时 在之前的实验中我们都使用到了按键&#xff0c;用到按键就要处理因为机械结构带来的按键抖动问题&#xff0c;也就是按键消…

ELK:Elasticsearch、Logstash、Kibana Spring Cloud Sleuth和Spring Cloud Zipkin

〇、虚拟机中docker安装elasticsearch 、Kibana、Logstash elasticsearch导入中文分词器 Logstash修改es数据库ip及创建索引名配置 一、elasticsearch数据库的结构 和mysql作比较&#xff0c;mysql中的数据库的二维表相当于es数据库的index索引结构&#xff1b;mysql数据库的二…

Java_EE ( IO 流技术)

什么是IO输入(Input)指的是&#xff1a;可以让程序从外部系统获得数据&#xff08;核心含义是“读”&#xff0c;读取外部数据&#xff09;。输出(Output)指的是&#xff1a;程序输出数据给外部系统从而可以操作外部系统&#xff08;核心含义是“写”&#xff0c;将数据写出到外…

七言-重阳寄友

题 记 九九重阳节&#xff0c;岁岁嵌在仲秋季节里&#xff0c;人们的心情也便随着气温的下降而逐渐地沉静下来。 丰收的喜悦洋溢在山水和田野之间。金黄的稻穗低垂着头&#xff0c;仿佛在向大地母亲致以最深情的敬意。 果园里&#xff0c;沉甸甸的苹果、梨子挂满枝头&#…

职场上的人情世故你知多少

1.发微信找人帮忙&#xff0c;半天不回&#xff0c;那基本没戏了&#xff0c;不要再打扰了&#xff0c;懂得都懂。 2.能力越大&#xff0c;事情越多&#xff0c;要懂得张弛有度&#xff0c;不要把自己全抛出去&#xff0c;给自己留点余地&#xff0c;毕竟你不知道别人如何暗地…

关于电动车新国标要求的北斗定位功能资料

一、安装及接口 电动自行车应内置北斗定位模块&#xff0c;安装于电动自行车不易损坏的固定部件中。定位装置所采用的芯片或模组应支持UAR或SPI接口至少支持接收处理北斗 B1C和B2a信号 二、定位检测环境 应具备接收实际卫星信号并进行电动自行车整车运行状态下检测的实验室条件…

【Axure安装包与汉化包附带授权证书】

一、下载Axure安装包与汉化包附带授权证书 1.下载汉化包 【快传】: 点击链接即可保存 2.解压安装包 解压下载好的压缩包&#xff0c;能看到有lang也就是汉化包&#xff0c;AxureRP-Setup-RC.exe 也就是Axure9的安装程序&#xff0c;以及汉化说明和授权码。 二、安装Axure9…

机器人末端的负载辨识

关节处的摩擦力变小了&#xff0c;导致系统的参数辨识精度会变高&#xff0c;因为动力学方程中的摩擦力项占的比例会变小。 为什么要有一个负载的参数辨识&#xff0c;因为对于整个系统来说&#xff0c;除了负载哈&#xff0c;其他关节都是不变的&#xff0c;出厂时都设置好了&…

用YOLOv5跑口罩佩戴识别时的一些问题解决

文章目录 1. 问题12. 问题23. 问题3 1. 问题1 1. 报错&#xff1a;TypeError: No loop matching the specified signature and casting was found for ufunc greater. 2. 原因&#xff1a;版本不兼容。 3. 解决&#xff1a; 先查看当前的 numpy 版本&#xff1a;pip list卸载当…

【动手学深度学习】5.2 参数管理(个人向笔记+代码注释)

之前的课程中&#xff0c;我们只是通过深度学习框架完成训练的工作&#xff0c;而忽略了操作参数的具体细节。所以我们我们介绍的内容有&#xff1a; 访问参数&#xff0c;用于调试&#xff0c;诊断和可视化参数初始化在不同的模型组件间共享参数 下面是一个有单隐藏层的多层感…

基于Python flask的豆瓣电影可视化系统,豆瓣电影爬虫系统

博主介绍&#xff1a;✌Java徐师兄、7年大厂程序员经历。全网粉丝13w、csdn博客专家、掘金/华为云等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精彩专栏推荐订阅&#x1f447;&#x1f3fb; 不…

猿人学 — 第1届第17题(解题思路附源码)

猿人学 — 第1届第17题 根据题目“天杀的Http2.0”大概知道&#xff0c;请求的协议应该遵照的是Http2.0协议&#xff0c;并且目标网站专门对此进行了检测&#xff0c;在Network面板中右键表头&#xff0c;勾选Protocol 果不其然&#xff0c;一堆请求都是遵照Http2.0协议。而u…

2023年4月自考《数据库系统原理》04735试题

目录 一:选择题 二:填空题 三:设计题 四:简答题 五:综合题 一:选择题 1.在数据库系统中&#xff0c;专门用户建立和管理数据的软件是 (书中)P28页 A.DBS B.DB C.DBA D.DBMS 2.通常所说的数据库系统容不包括 (书中)P29页 A.应用程序 B.数据库管理员 C.用户 D.网络环境 …

Datawhale 组队学习 文生图 Prompt攻防 task01

文生图大模型面临着巨大的滥用风险&#xff0c;如生成虚假、违法违规、血腥恐怖或歧视仇恨的图片&#xff0c;评估此类模型和系统的安全防范能力至关重要。 赛题背景&#xff1a;从产业应用需求出发&#xff0c;体验为大模型注入生成式“风险疫苗”&#xff0c;透视大模型生图潜…

Java SE vs Java EE 与 JVM vs JDK vs JRE

Java SE&#xff08;Java Platform&#xff0c;Standard Edition&#xff09;: Java 平台标准版&#xff0c;Java 编程语言的基础&#xff0c;它包含了支持 Java 应用程序开发和运行的核心类库以及虚拟机等核心组件。Java SE 可以用于构建桌面应用程序或简单的服务器应用程序。…

聚类分析 | IPOA优化FCM模糊C均值聚类优化算法

目录 效果一览基本介绍程序设计参考资料 效果一览 基本介绍 (多图聚类)IPOA优化FCM模糊C均值聚类优化算法&#xff0c;matlab代码&#xff0c;超多图 基于改进的鹈鹕优化算法&#xff08;IPOA&#xff09;优化FCM模糊C均值聚类优化&#xff0c;matlab代码&#xff0c;直接运行…

万字长文解读预测市场的历史发展与未来前景

撰文&#xff1a;Alex Nardi&#xff0c;Shoal Research 编译&#xff1a;Yangz&#xff0c;Techub News 文章要点&#xff1a; 预测市场的发展和影响&#xff1a;预测市场利用集体智慧预测未来事件的能力日益得到认可&#xff0c;对政治、金融、娱乐和流行文化等领域产生了重…

HiRT | 异步控制策略,告别VLA时延问题

论文&#xff1a;HiRT: Enhancing Robotic Control with Hierarchical Robot Transformers 前言&#xff1a;HiRT 通过异步处理的策略&#xff0c;将 VLM 作为低频慢思考过程&#xff0c;将轻量的动作策略模型作为高频快响应过程 &#xff0c;以此解决 VLA 驱动带来的控制时延问…

Ubuntu22.04环境下源码安装OpenCV 4.8.1

因为项目需要用OpenCV对yolov8模型进行推理&#xff0c;通过DNN模块&#xff0c;之前本地的OpenCV版本是4.5.4&#xff08;好像安装完ROS2 humble之后系统就自带了opencv&#xff09;&#xff0c;加载onnx模型一直报错&#xff0c;网上查询到需要4.7以上&#xff0c;干脆直接升…