You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

组长Master)N名 ,每个任务按 任务ID%N=第几个组长机进行执行下面的任务。
1生成关键帧 (一般速度较快)
2切开视频 (一般速度较快)
3生成待转码视频任务
组员处理机M
1
创建topic
/usr/local/kafka/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --partitions 3 --replication-factor 1 --topic test
删除topic
/usr/local/kafka/bin/kafka-topics.sh --delete --zookeeper 127.0.0.1:2181 --topic test
修改分区个数
/usr/local/kafka/bin/kafka-topics.sh --alter --zookeeper 127.0.0.1:2181 --topic dsideal_db --partitions 3
发送
/usr/local/kafka/bin/kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic test
测试接收
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic test --from-beginning
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic test
查看
/usr/local/kafka/bin/kafka-topics.sh --describe --zookeeper 127.0.0.1:2181 --topic test
消费者组[这个玩意有用!可以保证只有一个消费者获取到这条数据]
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic test --consumer-property group.id=group_mytest
# 有用的文章:
https://blog.csdn.net/u012369535/article/details/93844653
#如果处理机有N台宕机了如何处理异常
应该有一个定时检查已发布任务的轮询机制对于正常执行需要10分钟的任务现在超过了6*10还没有回写完成标识需要重新入队列即可解决。
# 关于优先级队列的理解和认识
http://qiankunli.github.io/2019/04/27/kafka_priority.html