有道云笔记做网站,手机端网站重构,旅游景点网页,网站上传图片加水印文章目录 1、集群主题创建1.1、查看 efak1.2、创建 主题 my_topic1 并建立6个分区并给每个分区建立3个副本1.2.1、查看 my_topic1 的详细信息 1.3、停止 kafka-01实例#xff0c;端口号为 9095 1、集群主题创建
1.1、查看 efak 已经有三个kafka实例 1.2、创建 主题 my_topic1… 文章目录 1、集群主题创建1.1、查看 efak1.2、创建 主题 my_topic1 并建立6个分区并给每个分区建立3个副本1.2.1、查看 my_topic1 的详细信息 1.3、停止 kafka-01实例端口号为 9095 1、集群主题创建
1.1、查看 efak 已经有三个kafka实例 1.2、创建 主题 my_topic1 并建立6个分区并给每个分区建立3个副本
[rootlocalhost ~]# kafka-topics.sh --bootstrap-server 192.168.74.148:9095,192.168.74.148:9096,192.168.74.148:9097 --create --topic my_topic1 --partitions 6 --replication-factor 3
WARNING: Due to limitations in metric names, topics with a period (.) or underscore (_) could collide. To avoid issues it is best to use either, but not both.
Created topic my_topic1.1.2.1、查看 my_topic1 的详细信息
[rootlocalhost ~]# kafka-topics.sh --bootstrap-server 192.168.74.148:9095,192.168.74.148:9096,192.168.74.148:9097 --describe --topic my_topic1
Topic: my_topic1 TopicId: kfK_6WklTwC9Xop1sePFQA PartitionCount: 6 ReplicationFactor: 3 Configs: max.message.bytes1000000Topic: my_topic1 Partition: 0 Leader: 96 Replicas: 96,97,95 Isr: 96,97,95Topic: my_topic1 Partition: 1 Leader: 95 Replicas: 95,96,97 Isr: 95,96,97Topic: my_topic1 Partition: 2 Leader: 97 Replicas: 97,95,96 Isr: 97,95,96Topic: my_topic1 Partition: 3 Leader: 96 Replicas: 96,95,97 Isr: 96,95,97Topic: my_topic1 Partition: 4 Leader: 95 Replicas: 95,97,96 Isr: 95,97,96Topic: my_topic1 Partition: 5 Leader: 97 Replicas: 97,96,95 Isr: 97,96,951.3、停止 kafka-01实例端口号为 9095 如果其中一个kafka实例挂掉了它会自动使用另外两个其中的一个实例上位 [rootlocalhost ~]# docker stop kafka-01
kafka-01[rootlocalhost ~]# kafka-topics.sh --bootstrap-server 192.168.74.148:9095,192.168.74.148:9096,192.168.74.148:9097 --describe --topic my_topic1
[2024-06-03 20:13:44,388] WARN [AdminClient clientIdadminclient-1] Connection to node -1 (/192.168.74.148:9095) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
Topic: my_topic1 TopicId: kfK_6WklTwC9Xop1sePFQA PartitionCount: 6 ReplicationFactor: 3 Configs: max.message.bytes1000000Topic: my_topic1 Partition: 0 Leader: 96 Replicas: 96,97,95 Isr: 96,97Topic: my_topic1 Partition: 1 Leader: 96 Replicas: 95,96,97 Isr: 96,97Topic: my_topic1 Partition: 2 Leader: 97 Replicas: 97,95,96 Isr: 97,96Topic: my_topic1 Partition: 3 Leader: 96 Replicas: 96,95,97 Isr: 96,97Topic: my_topic1 Partition: 4 Leader: 97 Replicas: 95,97,96 Isr: 97,96Topic: my_topic1 Partition: 5 Leader: 97 Replicas: 97,96,95 Isr: 97,9696实例上位也就是9096端口的kafka-02实例上位 如果此时再重新启动kafka-01实例此时它没有上位而是排在后面成为小弟 [rootlocalhost ~]# docker start kafka-01
kafka-01[rootlocalhost ~]# kafka-topics.sh --bootstrap-server 192.168.74.148:9095,192.168.74.148:9096,192.168.74.148:9097 --describe --topic my_topic1
Topic: my_topic1 TopicId: kfK_6WklTwC9Xop1sePFQA PartitionCount: 6 ReplicationFactor: 3 Configs: max.message.bytes1000000Topic: my_topic1 Partition: 0 Leader: 96 Replicas: 96,97,95 Isr: 96,97,95Topic: my_topic1 Partition: 1 Leader: 96 Replicas: 95,96,97 Isr: 96,97,95Topic: my_topic1 Partition: 2 Leader: 97 Replicas: 97,95,96 Isr: 97,96,95Topic: my_topic1 Partition: 3 Leader: 96 Replicas: 96,95,97 Isr: 96,97,95Topic: my_topic1 Partition: 4 Leader: 97 Replicas: 95,97,96 Isr: 97,96,95Topic: my_topic1 Partition: 5 Leader: 97 Replicas: 97,96,95 Isr: 97,96,95