当前位置: 首页 > news >正文

眉山网站建设公司/西安做推广优化的公司

眉山网站建设公司,西安做推广优化的公司,住房城乡建设委门户网站广州,wordpress版本列表文章目录Kafka Server启动生产、消费消息1. 生产消息2. 消费消息主题管理创建topic删除主题查看所有主题查看主题信息修改主题分区修改主题参数分区重分配修改主题限速消费者信息查看消费者位移查看消费者组提交的位移数据查看消费者组的状态信息参考Kafka Server启动 $ bin/k…

文章目录

  • Kafka Server启动
  • 生产、消费消息
    • 1. 生产消息
    • 2. 消费消息
  • 主题管理
    • 创建topic
    • 删除主题
    • 查看所有主题
    • 查看主题信息
    • 修改主题分区
    • 修改主题参数
    • 分区重分配
    • 修改主题限速
  • 消费者信息
    • 查看消费者位移
    • 查看消费者组提交的位移数据
    • 查看消费者组的状态信息
  • 参考

Kafka Server启动

$ bin/kafka-server-start.sh config/server.properties

生产、消费消息

1. 生产消息

$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic <topic_name> --request-required-acks all

2. 消费消息

$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic <topic_name> --group <group_name> --from-beginning --consumer-property enable.auto.commit=false 

如果不指定组名称(-group)的话,每次运行消费消息命令都会自动生成一个新的消费者组。

主题管理

创建topic

bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic <topic_name> --replication-factor 3 --partitions 5 

删除主题

bin/kafka-topics.sh --bootstrap-server broker_host:port --delete --topic <topic_name>

查看所有主题

bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

查看主题信息

bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic <topic_name>

修改主题分区

bin/kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic <topic_name> --partitions <partition_num>

目前Kafka不允许减少某个主题的分区数,指定的分区数一定要比原有分区数大。

修改主题参数

bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name <topic_name> --alter --add-config max.message.bytes=10485760

分区重分配

bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file reassign.json --execute

修改主题限速

主题限速主要是设置Leader和Follower副本使用的带宽:

bin/kafka-configs.sh --bootstrap-server localhost:9092 --alter --add-config 'leader.replication.throttled.rate=104857600,follower.replication.throttled.rate=104857600' --entity-type brokers --entity-name 0

设置所有Leader所有副本和Follower所有副本的带宽使用

bin/kafka-configs.sh --bootstrap-server localhost:9092 --alter --add-config 'leader.replication.throttled.replicas=*,follower.replication.throttled.replicas=*' --entity-type topics --entity-name test

消费者信息

查看消费者位移

bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <group_name>

查看消费者组提交的位移数据

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic __consumer_offsets --formatter "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageFormatter" --from-beginning

查看消费者组的状态信息

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic __consumer_offsets --formatter "kafka.coordinator.group.GroupMetadataManager\$GroupMetadataMessageFormatter" --from-beginning

参考

  1. http://kafka.apache.org/11/documentation.html#operations
  2. http://kafka.apache.org/11/documentation.html#configuration
http://www.jmfq.cn/news/5121361.html

相关文章:

  • 手机网站信任从哪里设置/app推广渠道
  • 伪静态网站网站 目录写入权限/网络营销渠道有哪些
  • 扬中市做网站/营销软文范文
  • 做网站水印/国内比较好的软文网站
  • 网站源码防盗原理/伊春seo
  • 网站查询系统怎么做/宁波seo优化报价多少
  • 淘宝店有给网站做优化am/今日热点新闻一览
  • 网站开发毕业答辩问题/windows优化大师好吗
  • 武汉网站建设的/爱站小工具
  • 怎么做淘客网站/互联网营销模式
  • 网站做seo需要大量文章/武汉seo人才
  • 扬州工程建设招标网/上海优化外包
  • 网站建设公司有多少钱/搜索引擎优化方法案例
  • 站长查询seo是什么意思/免费b站软件下载
  • 做网站的公司都有哪些/百度收录关键词
  • 海宁高端网站设计/营销战略
  • 优惠券精选网站怎么做/做seo必须有网站吗
  • 做兼职推荐网站/html网页制作动态效果
  • 个人网站备案能做什么内容/今日刚刚发生的新闻
  • 做交友网站的前景/怎么做网站排名
  • 电脑哪里做ppt下载网站/免费网站或软件
  • 新闻网站跟贴怎么做/广告投放价目表
  • 400选号网站源码/网络兼职平台
  • 百度霸屏培训/优化排名
  • 教你做网站的视频/账户竞价托管费用
  • 软件公司网站设计/前端性能优化有哪些方法
  • 企业管理咨询网站模板/seo收费低
  • 新网站如何做推广软文/长沙网站优化
  • 营销型网站建设方法/凡科网免费建站官网
  • 五华县建设局网站/百度网盟推广