3 # 创建三分区三副本主题 kafka-topics.sh --bootstrap-server node2:9092,node3:9092,node4:9092 --create --topic test topic test-1 kafka-topics.sh --bootstrap-server node2:9092,node3:9092,node4:9092 --describe --topic test : Topic: test-3 Partition: 0 Leader: 1 Replicas: 1,0,2 Isr: 1,0,2 Topic: test-3 Partition: 1 Leader: 0 Replicas: 0,2,1 Isr: 0,2,1 Topic: test-3 Partition: 2 Leader 测量 kafka 三分区生产者吞吐量 kafka-producer-perf-test.sh --topic test-3 --num-records 500000 --record-size 2048
1] docker pull image=adolphlwq/act-runner-ubuntu:22.04 platform= username= forcePull=true [test/test /act-runner-ubuntu:22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [test/test /act-runner-ubuntu:22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [test/test [] network="host" [test/test-1] ☁ git clone 'https://github.com/actions/setup-go' # ref=v5 [test/test -3] Non-terminating error while running 'git clone': some refs were not updated [test/test-3] ☁ git
应用pid 复制代码 2.3.5 现象 Exception in thread "test-2" Exception in thread "test-1" Exception in thread "test com.boot.example.ShutDownController : task execute complete... 2021-12-09 17:09:40.055 INFO 22383 --- [ test com.boot.example.ShutDownController : task execute complete... 2021-12-09 17:09:50.059 INFO 22383 --- [ test com.boot.example.ShutDownController : task execute complete... 2021-12-09 17:10:00.065 INFO 22383 --- [ test
height: 10px; background-color: gray; } .test-2 { height: 20px; background-color: gray; } .test
或者安装相同的软件,可以使用如下两种方法: 实验环境,有9台RHEL5.5_x64的主机,host表如下: test-1 10.9.1.1 test-2 10.9.1.2 test 默认的组,也可以使用-g参数指定不同的主机组 @test group test () +test-1 +test-2 +test
53 test-1 7 drwxrwxr-x 2 yun yun 141 Sep 15 18:53 test-2 8 drwxrwxr-x 2 yun yun 141 Sep 15 18:53 test 53 test-0 7 drwxrwxr-x 2 yun yun 141 Sep 15 18:53 test-1 8 drwxrwxr-x 2 yun yun 141 Sep 15 18:53 test
'bar-B' this[50] = 'test-50' this[9] = 'test-9' this[8] = 'test-8' this[3] = 'test console.log(`index:${key} value:${bar[key]}`) } 打印出来的结果如下: index:1 value:test-1 index:3 value:test
$ docker run -d --name test-3 nginx:alpine echo 123 $ docker run -d --name test-4 nginx:alpine ping
this["B"] = 'foo-B' this[50] = 'test-50' this[9] = 'test-9' this[8] = 'test-8' this[3] = 'test
test [root@controller ~]# openstack server list |grep test- | d8dc22d4-e657-4c54-96f9-3a53ca67533d | test Permanently added '192.168.123.10' (RSA) to the list of known hosts. cirros@192.168.123.10's password: test
2046)->(0x1, 1)->end Curr:2022020-12-04T04:31:32.308Z dockerd Releasing addresses for endpoint test
9092,node3:9092,node4:9092 __consumer_offsets connect-configs connect-offsets connect-status test-1 test connect-offsets connect-status mysql-hbase-test mysql-hbase-test.test.t1 schemahistory.mysql-hbase-test test-1 test
Kafka的存储目录为 /kafka-logs ,test-0 ~ test-3 为主题 test 的 4 个分区。分区文件夹的名字是主题名加上分区编号,编号从 0 开始。
BusinessEventListener 收到消息 com.example.spring.event.source.BusinessEvent eventPublisher 发送 businessEvent Test
emit(request) } .collect { value -> println(value) } } test-1 1 test-2 2 test
} } 输出结果: offset=0, key=test-1, value=test-1 offset=1, key=test-2, value=test-2 offset=2, key=test -3, value=test-3 offset=3, key=test-4, value=test-4 offset=4, key=test-5, value=test-5 offset=5, key
this['B'] = 'bar-B'; this[50] = 'test-50'; this[9] = 'test-9'; this[8] = 'test-8'; this[3] = 'test console.log(`index:${key} value:${bar[key]}`); } //输出: // index:1 value:test-1 // index:3 value:test
this['B'] = 'bar-B'; this[50] = 'test-50'; this[9] = 'test-9'; this[8] = 'test-8'; this[3] = 'test console.log(`index:${key} value:${bar[key]}`); } //输出: // index:1 value:test-1 // index:3 value:test
this['B'] = 'bar-B'; this[50] = 'test-50'; this[9] = 'test-9'; this[8] = 'test-8'; this[3] = 'test console.log(`index:${key} value:${bar[key]}`); } //输出: // index:1 value:test-1 // index:3 value:test
针对下图中情况,3 个分区(test-0 ~ test-3),3 个消费者(ConsumerA ~ C),哪个消费者应该消费哪个分区的消息呢?? 对于如上这种情况,3 个分区, 3 个消费者。