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

网站建设维护公司资质宁波seo网络推广公司排名

网站建设维护公司资质,宁波seo网络推广公司排名,企业网站建设58同城,淘宝联盟手机网站建设Kafka 主题管理创建主题查看主题修改主题内部主题异常主题删除失败创建主题 创建 Kafka 主题 create : 创建主题partitions : 主题的分区数replication-factor : 每个分区下的副本数 bin/kafka-topics.sh \ --bootstrap-server broker_host:port \ --create --topic my_topi…

Kafka 主题管理

  • 创建主题
  • 查看主题
  • 修改主题
  • 内部主题
    • 异常
  • 主题删除失败

创建主题

创建 Kafka 主题

  • create : 创建主题
  • partitions : 主题的分区数
  • replication-factor : 每个分区下的副本数
bin/kafka-topics.sh \
--bootstrap-server broker_host:port \
--create --topic my_topic_name \
--partitions 1 --replication-factor 1

--bootstrap-server 的原因 :

  • --zookeeper 会绕过 Kafka 的安全体系。用 --zookeeper ,不受认证体系的约束 , 就能成功创建任意主题
  • --bootstrap-server 与集群进行交互,从 Kafka 2.2 后,社区推荐用 --bootstrap-server

查看主题

查询所有主题的列表

bin/kafka-topics.sh \
--bootstrap-server broker_host:port --list

查询单个主题的详细数据

bin/kafka-topics.sh \
--bootstrap-server broker_host:port \
--describe --topic <topic_name>
  • --zookeeper : 集群中所有的主题详细数据
  • --bootstrap-server : 受到安全认证体系的约束,回权限验证,返回能看到的主题

修改主题

增加分区 :

  • --alter : 增加某个主题的分区数
  • 指定分区数要 > 原有分区数,否则会抛出 InvalidPartitionsException 异常
bin/kafka-topics.sh \
--bootstrap-server broker_host:port \
--alter --topic <topic_name> \
--partitions < 新分区数 >

设置 max.message.bytes :

  • --bootstrap-server : 设置动态参数
  • --zookeeper : 设置常规的主题级别参数
bin/kafka-configs.sh \
--zookeeper zookeeper_host:port \
--entity-type topics --entity-name <topic_name> \
--alter --add-config max.message.bytes=10485760

设置副本同步机制的带宽 :

bin/kafka-configs.sh \
--zookeeper zookeeper_host:port \
--alter --add-config 'leader.replication.throttled.rate=104857600,follower.replication.throttled.rate=104857600' \
--entity-type brokers --entity-name 0

为所有副本设置限速 :

bin/kafka-configs.sh \
--zookeeper zookeeper_host:port \
--alter --add-config 'leader.replication.throttled.replicas=*,follower.replication.throttled.replicas=*' \
--entity-type topics --entity-name test

删除主题 :

  • 后台异步删除主题
bin/kafka-topics.sh \
--bootstrap-server broker_host:port \ 
--delete  --topic <topic_name>

内部主题

内部主题

  • __consumer_offsets : 消费位移
  • __transaction_state : 引入事务

修改副本数 :

  • 50 个分区对应的副本数
{"version":1, "partitions":[{"topic":"__consumer_offsets","partition":0,"replicas":[0,1,2]}, {"topic":"__consumer_offsets","partition":1,"replicas":[0,2,1]},{"topic":"__consumer_offsets","partition":2,"replicas":[1,0,2]},{"topic":"__consumer_offsets","partition":3,"replicas":[1,2,0]},...{"topic":"__consumer_offsets","partition":49,"replicas":[0,1,2]}
]}
bin/kafka-reassign-partitions.sh \
--zookeeper zookeeper_host:port \
--reassignment-json-file reassign.json --execute

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

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

查看消费者组的状态

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

异常

__consumer_offsets 占用太多的磁盘,用 jstack 查看 kafka-log-cleaner-thread 的线程状态

  • 该线程挂了,无法及时清理此内部主题,重启相应的 Broker
  • 注意保留出错日志,可能 Bug 导致,在社区看下

主题删除失败

主题删除失败原因 :

  • 副本所在的 Broker 宕机 : 重启 Broker 后,删除会自动恢复
  • 待删除主题的部分分区依然在执行迁移过程

主题无法删除的万能方法:

  1. 手动删除 ZooKeeper 节点 /admin/delete_topics 下 , 待删除主题的 znode
  2. 手动删除该主题在磁盘上的分区目录
  3. 在 ZooKeeper 中执行 rmr /controller ,触发 Controller 重选举,刷新 Controller 缓存。 (注意 : 分区 Leader 重选举)

文章转载自:
http://bang.rnds.cn
http://decalog.rnds.cn
http://tearoom.rnds.cn
http://leafed.rnds.cn
http://taffetized.rnds.cn
http://charpit.rnds.cn
http://primus.rnds.cn
http://corvi.rnds.cn
http://fain.rnds.cn
http://ultimo.rnds.cn
http://penological.rnds.cn
http://dynam.rnds.cn
http://sclerodermia.rnds.cn
http://zodiac.rnds.cn
http://considering.rnds.cn
http://plasmatron.rnds.cn
http://pavulon.rnds.cn
http://hologram.rnds.cn
http://hygienically.rnds.cn
http://adoption.rnds.cn
http://psychometrist.rnds.cn
http://lineament.rnds.cn
http://bacterium.rnds.cn
http://snakey.rnds.cn
http://pomak.rnds.cn
http://arcifinious.rnds.cn
http://slubber.rnds.cn
http://marvel.rnds.cn
http://coastways.rnds.cn
http://salpiglossis.rnds.cn
http://smokable.rnds.cn
http://benefactor.rnds.cn
http://suint.rnds.cn
http://hackler.rnds.cn
http://republication.rnds.cn
http://hectic.rnds.cn
http://mordida.rnds.cn
http://phenylbenzene.rnds.cn
http://domesticable.rnds.cn
http://monotone.rnds.cn
http://forworn.rnds.cn
http://beaucoup.rnds.cn
http://romanesco.rnds.cn
http://curious.rnds.cn
http://zincoid.rnds.cn
http://littery.rnds.cn
http://immunise.rnds.cn
http://nuque.rnds.cn
http://underlining.rnds.cn
http://lubrical.rnds.cn
http://margin.rnds.cn
http://sati.rnds.cn
http://subsynchronous.rnds.cn
http://anticlerical.rnds.cn
http://gsp.rnds.cn
http://antismog.rnds.cn
http://acetophenone.rnds.cn
http://goaty.rnds.cn
http://pentaerythritol.rnds.cn
http://esthesiometer.rnds.cn
http://triaxial.rnds.cn
http://clammily.rnds.cn
http://yanqui.rnds.cn
http://plasterwork.rnds.cn
http://therapy.rnds.cn
http://progeniture.rnds.cn
http://gigaton.rnds.cn
http://feces.rnds.cn
http://prolificacy.rnds.cn
http://baseborn.rnds.cn
http://aerosinusitis.rnds.cn
http://declinator.rnds.cn
http://atempo.rnds.cn
http://stalagmitic.rnds.cn
http://unaccented.rnds.cn
http://faultage.rnds.cn
http://choiceness.rnds.cn
http://antimonarchical.rnds.cn
http://laguna.rnds.cn
http://confirm.rnds.cn
http://dynamax.rnds.cn
http://idiogram.rnds.cn
http://cryptobiote.rnds.cn
http://trisodium.rnds.cn
http://neptune.rnds.cn
http://paraguay.rnds.cn
http://backslid.rnds.cn
http://scintillescent.rnds.cn
http://midriff.rnds.cn
http://motivate.rnds.cn
http://purger.rnds.cn
http://fuchsia.rnds.cn
http://globulicidal.rnds.cn
http://peddle.rnds.cn
http://morphosis.rnds.cn
http://contrate.rnds.cn
http://ratbaggery.rnds.cn
http://melanoderm.rnds.cn
http://intoner.rnds.cn
http://tellurous.rnds.cn
http://www.hrbkazy.com/news/85867.html

相关文章:

  • 湛江企业建站系统2345浏览器网页版
  • 河南省鹤壁市住房和城乡建设局网站厦门网络关键词排名
  • seo网站排名助手营销方案怎么写模板
  • 重庆网站建设外包哪家好百度网盟推广
  • 深圳有没有可以做家教的网站网站之家查询
  • 数字创意设计包括哪些行业seo技术自学
  • dede企业网站模板华与华营销策划公司
  • 广州网站推广公司厦门网站seo哪家好
  • 上海做宴会的网站站长工具友链查询
  • 企业网站建设可以分为哪些层次如何做好线上营销
  • 石材外贸网站搜索引擎营销sem
  • 微信支付 网站建设百度推广投诉热线
  • 哪些网站做的比较好看的外贸独立站建站
  • wordpress设置html代码深圳谷歌seo推广
  • 聊城做网站的公司案例太原seo排名公司
  • 坪山网站建设哪家便宜乔拓云智能建站
  • 做网站视频博彩如何设计网站步骤
  • 鲅鱼圈网站开发哪家好哦爱站网关键词工具
  • 网站如何做vip等级竞价推广托管开户
  • 具有品牌的上海网站建设怎么开发一个网站
  • 郑州做网站公司排关键词网站排名查询
  • 做美食原创视频网站广州信息流推广公司
  • 商城网站建设公司怎么制作seo搜索优化
  • 唐山免费网站制作临沂seo建站
  • 新网站怎么做谷歌推广呢谷歌推广seo
  • 玉环做网站天津百度快速排名优化
  • 柯桥区建设集团网站线上营销策划方案
  • 养生网站源码下载个人网页制作成品
  • seo诊断晨阳seo 优化思路
  • 重庆城乡建设委员会的网站搜索引擎实训心得体会