配置中心健康檢查配置不合理導(dǎo)致的全局事故

前段時間遇到一場事故,配置中心服務(wù)依賴的 git 數(shù)據(jù)源不可訪問,K8s deployment 里配置的健康檢查超時時間較短,(如果超時時間設(shè)置為10s, 是不會觸發(fā)這次故障的)導(dǎo)致配置中心服務(wù)健康檢查掛掉,網(wǎng)關(guān)默認強依賴配置中心服務(wù),所以網(wǎng)關(guān)健康檢查接口也不通過,所以在負載均衡看來,網(wǎng)關(guān)也不可用,導(dǎo)致整體服務(wù)中斷。

為了實現(xiàn)服務(wù)高可用,我們會做以下2 點優(yōu)化:

  1. 去除網(wǎng)關(guān)對于配置中心的強依賴
  2. 去除配置中心對 git 服務(wù)的強依賴

disable config client health indicator

https://github.com/spring-cloud/spring-cloud-config/issues/435

The Config Client supplies a Spring Boot Health Indicator that attempts to load configuration from Config Server. The health indicator can be disabled by setting health.config.enabled=false. The response is also cached for performance reasons. The default cache time to live is 5 minutes. To change that value set the health.config.time-to-live property (in milliseconds).

management.health.hystrix.enabled: false

health.config.enabled: false

上面是spring boot 的配置方法 (https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html)
下面是spring cloud

反思

  • 對連鎖故障處理不夠熟練
  • 事故過程信息傳遞不夠到位
  • 系統(tǒng)存在單點設(shè)計,引起全局問題
  • 需定期安排災(zāi)難演練 有興趣的讀者可以了解一下 chaosmonkey
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容