欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

kafka 啟動(dòng)報(bào)錯(cuò) missingTopicsFatal is true的解決

 更新時(shí)間:2021年07月03日 14:57:46   作者:o_瓜田李下_o  
這篇文章主要介紹了kafka 啟動(dòng)報(bào)錯(cuò) missingTopicsFatal is true的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

kafka 啟動(dòng)報(bào)錯(cuò):missingTopicsFatal is true

報(bào)錯(cuò)信息

org.springframework.context.ApplicationContextException: Failed to start bean 'org.springframework.kafka.config.internalKafkaListenerEndpointRegistry'; nested exception is java.lang.IllegalStateException: Topic(s) [async] is/are not present and missingTopicsFatal is true
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:894) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]

報(bào)錯(cuò)原因:消費(fèi)監(jiān)聽接口監(jiān)聽的主題不存在時(shí),默認(rèn)會(huì)報(bào)錯(cuò)

解決方法:

配置文件中將listener的屬性missingTopicsFatal設(shè)置為false

spring:
  kafka:
    listener:
      missing-topics-fatal: false

kafka常見報(bào)錯(cuò)警告異常解決

1.自行修改server.properties中broker id后造成與meta.properties中數(shù)據(jù)不匹配

kafka.common.InconsistentBrokerIdException: Configured broker.id 2 doesn't match stored broker.id 1 in meta.properties. If you moved your data, make sure your configured broker.id matches. If you intend to create a new broker, you should remove all data in your data directories (log.dirs).

2.__consumer_offsets這個(gè)topic是由kafka自動(dòng)創(chuàng)建的,默認(rèn)49個(gè),這個(gè)topic是不能被刪除的!

Error while executing topic command : Topic __consumer_offsets is a kafka internal topic and is not allowed to be marked for deletion.

為什么這里會(huì)是這樣存儲(chǔ)__consumer_offsets的呢:

  • [1.] 將所有 N Broker 和待分配的 i 個(gè) Partition 排序
  • [2.] 將第 i 個(gè) Partition 分配到第(i mod n)個(gè) Broker 上

3.刪除topic時(shí)

Topic frist is already marked for deletion.

在這里插入圖片描述

徹底刪除topic:

  • [1. ] 刪除Topic,delete.topic.enable=true這里要設(shè)置為true
  • [2. ] 刪除log日志
  • [3. ] 刪除ZK中的Topic記錄

這里是引用

命令:./bin/zkCli.sh

找到topic所在的目錄:ls /brokers/topics

執(zhí)行命令:rmr /brokers/topics/{topic name}即可,此時(shí)topic被徹底刪除。

另外被標(biāo)記為marked for deletion的topic你可以在zookeeper客戶端中通過命令獲得:ls /admin/delete_topics/{topic name},如果你刪除了此處的topic,那么marked for deletion 標(biāo)記消失

當(dāng)然,這里是你delete.topic.enable設(shè)置為false時(shí)Zookeeper下才會(huì)有這個(gè)節(jié)點(diǎn)。

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Java實(shí)現(xiàn)excel表格轉(zhuǎn)成json的方法

    Java實(shí)現(xiàn)excel表格轉(zhuǎn)成json的方法

    本篇文章主要介紹了Java實(shí)現(xiàn)excel表格轉(zhuǎn)成json的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-09-09
  • Spring Boot 中常用的注解@RequestParam及基本用法

    Spring Boot 中常用的注解@RequestParam及基本用法

    @RequestParam 是 Spring Framework 和 Spring Boot 中常用的注解之一,用于從請(qǐng)求中獲取參數(shù)值,本文給大家介紹Spring Boot 中常用的注解@RequestParam,感興趣的朋友一起看看吧
    2023-10-10
  • spring boot 項(xiàng)目中使用thymeleaf模板的案例分析

    spring boot 項(xiàng)目中使用thymeleaf模板的案例分析

    這篇文章主要介紹了spring boot 項(xiàng)目中使用thymeleaf模板的案例分析,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-09-09
  • java實(shí)現(xiàn)高效下載文件的方法

    java實(shí)現(xiàn)高效下載文件的方法

    這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)高效下載文件的幾種方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-08-08
  • JavaEE實(shí)現(xiàn)前后臺(tái)交互的文件上傳與下載

    JavaEE實(shí)現(xiàn)前后臺(tái)交互的文件上傳與下載

    這篇文章主要介紹了JavaEE實(shí)現(xiàn)前后臺(tái)交互的文件上傳與下載,分享相關(guān)技術(shù),實(shí)現(xiàn)文件上傳下載功能,需要的朋友可以參考下
    2015-11-11
  • Java中的顯示鎖ReentrantLock使用與原理詳解

    Java中的顯示鎖ReentrantLock使用與原理詳解

    這篇文章主要介紹了Java中的顯示鎖ReentrantLock使用與原理詳解,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-11-11
  • Java反射機(jī)制概念、原理與用法總結(jié)

    Java反射機(jī)制概念、原理與用法總結(jié)

    這篇文章主要介紹了Java反射機(jī)制概念、原理與用法,較為詳細(xì)的分析了java反射機(jī)制的概念、原理,并結(jié)合實(shí)例形式總結(jié)分析了java反射機(jī)制的具體使用方法與相關(guān)注意事項(xiàng),需要的朋友可以參考下
    2017-11-11
  • Java yield()線程讓步實(shí)現(xiàn)過程解析

    Java yield()線程讓步實(shí)現(xiàn)過程解析

    這篇文章主要介紹了Java yield()線程讓步實(shí)現(xiàn)過程解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-03-03
  • springMvc全局異常的實(shí)現(xiàn)

    springMvc全局異常的實(shí)現(xiàn)

    大家好,本篇文章主要講的是springMvc全局異常的實(shí)現(xiàn),感興趣的同學(xué)趕緊來看一看吧,對(duì)你有幫助的話記得收藏一下
    2022-02-02
  • 淺談一下Java線程組ThreadGroup

    淺談一下Java線程組ThreadGroup

    ThreadGroup是為了方便線程管理出現(xiàn)了,可以統(tǒng)一設(shè)定線程組的一些屬性,比如setDaemon,設(shè)置未處理異常的處理方法,設(shè)置統(tǒng)一的安全策略等等,需要的朋友可以參考下
    2023-05-05

最新評(píng)論