高可用集群
集群類型
-LB:Load Balance 負載均衡
? LVS/HAProxy/nginx(http/upstream, stream/upstream)
-HA:High Availability 高可用集群
? 數據庫、Zookeeper、Redis
? SPoF: Single Point of Failure,解決單點故障
-HPC:High Performance Computing 高性能集群
系統可用性
SLA:Service-Level Agreement
A = MTBF / (MTBF+MTTR)
95%=(602430)*(1-0.9995)
指標 :99.9%, …, 99.999%,99.9999%
系統故障
硬件故障:設計缺陷、wear out(損耗)、自然災害……
軟件故障:設計缺陷 bug
實現高可用
提升系統高用性的解決方案:降低MTTR- Mean Time To Repair(平均故障時間)
解決方案:建立冗余機制
- active/passive 主/備
- active/active 雙主
- active –> HEARTBEAT –> passive
- active <–> HEARTBEAT <–> active
高可用相關技術
HA service:
資源:組成一個高可用服務的“組件”,比如:vip,service process,shared storage
(1) passive node的數量
(2) 資源切換
shared storage:
- NAS(Network Attached Storage):網絡附加存儲,基于網絡的共享文件系統。
- SAN(Storage Area Network):存儲區域網絡,基于網絡的塊級別的共享
Network partition 網絡分區
quorum 法定人數
with quorum: > total/2
without quorum: <= total/2
隔離設備 fence
node:STONITH = Shooting The Other Node In The Head(強制下線/斷電)
參考資料:
https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/high_availability_add-on_reference/s1-unfence-haar
雙節點集群(TWO nodes Cluster)
輔助設備:ping node, quorum disk(仲裁設備)
- Failover:故障切換,即某資源的主節點故障時,將資源轉移至其它節點的操作
- Failback:故障移回,即某資源的主節點故障后重新修改上線后,將之前已轉移至其它節點的資源重新切回的過程
HA Cluster實現方案:
AIS:Applicaiton Interface Specification 應用程序接口規范
- RHCS:Red Hat Cluster Suite紅帽集群套件
參考資料:https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/5/html/cluster_suite_overview/ch.gfscs.cluster-overview-cso
- heartbeat:基于心跳監測實現服務高可用
- pacemaker+corosync:資源管理與故障轉移
vrrp:Virtual Router Redundancy Protocol
虛擬路由冗余協議,解決靜態網關單點風險
-軟件層—keepalived
-物理層—路由器、三層交換機
本文鏈接:http://www.royaladd.com/35350.html
網友評論comments