記一次Consul故障分析與優化

{"type":"doc","content":[{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"前言"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在微服務體系中,服務註冊中心是最基礎的組件,它的穩定性會直接影響整個服務體系的穩定性。本文主要介紹了愛奇藝微服務平臺基於Consul的服務註冊中心建設方式,與內部容器平臺、API網關的集成情況,並重點記錄了Consul遇到的一次故障,分析解決的過程,以及針對這次故障從架構上的優化調整措施。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Consul 是近幾年比較流行的服務發現工具,用於實現分佈式系統的服務發現與配置。與其它分佈式服務註冊與發現的方案相比Consul 的方案更“一站式”,使用起來也較 爲簡單。他的主要應用場景爲:服務發現、服務隔離、服務配置。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.consul.io\/","title":"","type":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"Consul傳送門"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"01. 註冊中心背景及Consul的使用"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從微服務平臺的角度出發希望提供統一的服務註冊中心,讓任何的業務和團隊只要使用這套基礎設施,相互發現只需要協商好服務名即可;還需要支持業務做多DC部署和故障切換。由於在擴展性和多DC支持上的良好設計,我們選擇了Consul,並採用了Consul推薦的架構,單個DC內有Consul Server和Consul Agent,DC之間是WAN模式並且相互對等,結構如下圖所示。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/a7\/70\/a746035253a871ab1f045f4f3bb60f70.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"注:圖中只畫了四個DC,實際生產環境根據公司機房建設以及第三方雲的接入情況,共有十幾個DC。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"02. 與 QAE 容器應用平臺集成"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章