SlideShare a Scribd company logo
⾼高可⽤用架构
——从上层应⽤用到底层硬件
娄振林林
Outline
• 何为⾼高可⽤用
• 应⽤用层⾯面
• 硬件层⾯面
– wikipedia
“High availability is a characteristic of a system,
which aims to ensure an agreed level of
operational performance, usually uptime, for a
higher than normal period.”
⾼高可⽤用
⾼高可⽤用
• 单点
• 冗余
• 服务多副本
• 存储多副本
• failover -> 少量量时间的不不可⽤用(10s级、分钟级)
• 故障检测
• ⾃自动切换
⾼高可⽤用
• 故障检测
• ICMP检测 -> ⽹网络可达
• Port检测 -> 应⽤用进程可达
• 服务检测 -> 服务可⽤用
DNS
LVS LVS
LVS Group 1
LVS LVS
LVS Group N
Reverse Proxy
API Cluster
Moa Cluster
Storage
Redis MySQL HBase
陌
陌
架
构
接⼊入层
• LVS + Keepalived
LVS
Keepaliived
……
接⼊入层
• LVS冗余
• VRRP(Virtual Router Redundancy Protocol)
• VIP漂移
LVS 主 LVS 备
Keepaliived
VRRP
Keepaliived
VIP
LVS 主 LVS 备
Keepaliived Keepaliived
VIP
接⼊入层
• 吞吐量量达到单台LVS上限?
• ⽹网卡流量量、CPU……
接⼊入层
• DNS轮询
• ⼀一个域名 => 多个IP
DNS
LVS Group1 LVS Group2
VIP1 VIP2
反向代理理层
• 七层负载均衡
• 更更细粒度的流量量分发
• 模块化
API集群
• 服务冗余部署,依赖反向代理理层做failover
MOA集群
• 服务冗余部署
• 宕机:服务注册中⼼心(MomoKeeper)
• 慢:MOA-Watcher
存储层
• Replication
• 主从⾃自动切换
Redis
• 主从
• sentinel: https://moji.wemomo.com/article/2832
• 集群⽅方案:
• Redis Cluster
• Codis
MySQL
• 主从
• MHA:解决主挂的情况
• 从挂:
• 类似sentinel
• MMM、PXC
• Proxy
HBase
• 分布式存储系统
• ⾼高可⽤用保证:
• zookeeper存储元数据,多个HMaster避免单点
• 数据存放在底层的分布式⽂文件系统,保证多副本及
failover
机房⽹网络架构
接⼊交换机
汇聚交换机
……
……
……
Internet
汇聚交换机 汇聚交换机
接⼊交换机 接⼊交换机
核⼼交换机
⽹网卡⾼高可⽤用
• bonding
• 多块⽹网卡 => ⼀一块虚拟⽹网卡
• 流量量分发
• 轮询、主备、hash、⼴广播......
链路路⾼高可⽤用
• LACP
• Link Aggregation Control Protocol,链路路汇聚控制
协议
• STP
• Spanning Tree Protocol,⽣生成树协议
核⼼心交换机⾼高可⽤用
• 提供⽹网络层功能
• VRRP,ECMP….
• 思科核⼼心交换机
• HSRP(Hot Standby Router Protocol)
机架⾼高可⽤用
• 服务不不能部署在同⼀一个机架
• 存储的⼀一对主从不不能部署在同⼀一个机架
机房⾼高可⽤用
• 数据源跨机房复制
• 服务跨机房访问
• ⽤用户接⼊入调度
Thank you

More Related Content

What's hot

Hacking Nginx at Taobao
Hacking Nginx at TaobaoHacking Nginx at Taobao
Hacking Nginx at TaobaoJoshua Zhu
 
Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Yang Guanjun
 
Traffic server overview
Traffic server overviewTraffic server overview
Traffic server overviewqianshi
 
cdn的那些事儿
cdn的那些事儿cdn的那些事儿
cdn的那些事儿rfyiamcool
 
Golang advance
Golang advanceGolang advance
Golang advancerfyiamcool
 
Ceph in UnitedStack
Ceph in UnitedStackCeph in UnitedStack
Ceph in UnitedStackRongze Zhu
 
Traffic server 管理员指南v1.0
Traffic server 管理员指南v1.0Traffic server 管理员指南v1.0
Traffic server 管理员指南v1.0qianshi
 
主库自动切换 V2.0
主库自动切换 V2.0主库自动切换 V2.0
主库自动切换 V2.0jinqing zhu
 
Kubernetes use-ceph
Kubernetes use-cephKubernetes use-ceph
Kubernetes use-cephYang Guanjun
 
快速搭建高性能服务端
快速搭建高性能服务端快速搭建高性能服务端
快速搭建高性能服务端moonbingbing
 
阿里CDN技术揭秘
阿里CDN技术揭秘阿里CDN技术揭秘
阿里CDN技术揭秘Joshua Zhu
 
反向代理工作原理及Squid简介
反向代理工作原理及Squid简介反向代理工作原理及Squid简介
反向代理工作原理及Squid简介diruser
 
Building the Production Ready EB level Storage Product from Ceph - Dongmao Zhang
Building the Production Ready EB level Storage Product from Ceph - Dongmao ZhangBuilding the Production Ready EB level Storage Product from Ceph - Dongmao Zhang
Building the Production Ready EB level Storage Product from Ceph - Dongmao ZhangCeph Community
 
Apache trafficserver
Apache trafficserverApache trafficserver
Apache trafficserverDin Dindin
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAEq3boy
 
深入Docker的资源管理
深入Docker的资源管理深入Docker的资源管理
深入Docker的资源管理SpeedyCloud
 

What's hot (20)

Hacking Nginx at Taobao
Hacking Nginx at TaobaoHacking Nginx at Taobao
Hacking Nginx at Taobao
 
Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Cephfs架构解读和测试分析
Cephfs架构解读和测试分析
 
Ceph intro
Ceph introCeph intro
Ceph intro
 
Ceph monitor-op
Ceph monitor-opCeph monitor-op
Ceph monitor-op
 
Ceph perf-tunning
Ceph perf-tunningCeph perf-tunning
Ceph perf-tunning
 
Traffic server overview
Traffic server overviewTraffic server overview
Traffic server overview
 
cdn的那些事儿
cdn的那些事儿cdn的那些事儿
cdn的那些事儿
 
Golang advance
Golang advanceGolang advance
Golang advance
 
Ceph in UnitedStack
Ceph in UnitedStackCeph in UnitedStack
Ceph in UnitedStack
 
Traffic server 管理员指南v1.0
Traffic server 管理员指南v1.0Traffic server 管理员指南v1.0
Traffic server 管理员指南v1.0
 
Oracle dgha
Oracle dghaOracle dgha
Oracle dgha
 
主库自动切换 V2.0
主库自动切换 V2.0主库自动切换 V2.0
主库自动切换 V2.0
 
Kubernetes use-ceph
Kubernetes use-cephKubernetes use-ceph
Kubernetes use-ceph
 
快速搭建高性能服务端
快速搭建高性能服务端快速搭建高性能服务端
快速搭建高性能服务端
 
阿里CDN技术揭秘
阿里CDN技术揭秘阿里CDN技术揭秘
阿里CDN技术揭秘
 
反向代理工作原理及Squid简介
反向代理工作原理及Squid简介反向代理工作原理及Squid简介
反向代理工作原理及Squid简介
 
Building the Production Ready EB level Storage Product from Ceph - Dongmao Zhang
Building the Production Ready EB level Storage Product from Ceph - Dongmao ZhangBuilding the Production Ready EB level Storage Product from Ceph - Dongmao Zhang
Building the Production Ready EB level Storage Product from Ceph - Dongmao Zhang
 
Apache trafficserver
Apache trafficserverApache trafficserver
Apache trafficserver
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAE
 
深入Docker的资源管理
深入Docker的资源管理深入Docker的资源管理
深入Docker的资源管理
 

Similar to 高可用

PHP Optimization for Millions Visits Level
PHP Optimization for Millions Visits LevelPHP Optimization for Millions Visits Level
PHP Optimization for Millions Visits LevelHo Kim
 
Nosql三步曲
Nosql三步曲Nosql三步曲
Nosql三步曲84zhu
 
阿里云技术实践
阿里云技术实践阿里云技术实践
阿里云技术实践drewz lin
 
淘宝主备数据库自动切换
淘宝主备数据库自动切换淘宝主备数据库自动切换
淘宝主备数据库自动切换mysqlops
 
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控Michael Zhang
 
MySQL自动切换设计与实现
MySQL自动切换设计与实现MySQL自动切换设计与实现
MySQL自动切换设计与实现orczhou
 
TechCCU Workshop OpenFlow Introduction
TechCCU Workshop OpenFlow IntroductionTechCCU Workshop OpenFlow Introduction
TechCCU Workshop OpenFlow Introductionicemango
 
大规模网站架构
大规模网站架构大规模网站架构
大规模网站架构drewz lin
 
Redis在唯品会的应用实践.pdf
Redis在唯品会的应用实践.pdfRedis在唯品会的应用实践.pdf
Redis在唯品会的应用实践.pdfjaydenhu
 
淘宝前台系统性能分析与优化
淘宝前台系统性能分析与优化淘宝前台系统性能分析与优化
淘宝前台系统性能分析与优化丁 宇
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构n716
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1Zoom Quiet
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路jeffz
 
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)Shanda innovation institute
 
Lvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukongLvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukongMichael Zhang
 
了解应用服务器
了解应用服务器了解应用服务器
了解应用服务器Feng Yu
 
分布式缓存与队列
分布式缓存与队列分布式缓存与队列
分布式缓存与队列XiaoJun Hong
 
Track2 -刘继伟--openstack in gamewave
Track2 -刘继伟--openstack in gamewaveTrack2 -刘继伟--openstack in gamewave
Track2 -刘继伟--openstack in gamewaveOpenCity Community
 

Similar to 高可用 (20)

PHP Optimization for Millions Visits Level
PHP Optimization for Millions Visits LevelPHP Optimization for Millions Visits Level
PHP Optimization for Millions Visits Level
 
Nosql三步曲
Nosql三步曲Nosql三步曲
Nosql三步曲
 
阿里云技术实践
阿里云技术实践阿里云技术实践
阿里云技术实践
 
淘宝主备数据库自动切换
淘宝主备数据库自动切换淘宝主备数据库自动切换
淘宝主备数据库自动切换
 
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
 
MySQL自动切换设计与实现
MySQL自动切换设计与实现MySQL自动切换设计与实现
MySQL自动切换设计与实现
 
Hantuo openstack
Hantuo openstackHantuo openstack
Hantuo openstack
 
TechCCU Workshop OpenFlow Introduction
TechCCU Workshop OpenFlow IntroductionTechCCU Workshop OpenFlow Introduction
TechCCU Workshop OpenFlow Introduction
 
大规模网站架构
大规模网站架构大规模网站架构
大规模网站架构
 
Redis在唯品会的应用实践.pdf
Redis在唯品会的应用实践.pdfRedis在唯品会的应用实践.pdf
Redis在唯品会的应用实践.pdf
 
淘宝前台系统性能分析与优化
淘宝前台系统性能分析与优化淘宝前台系统性能分析与优化
淘宝前台系统性能分析与优化
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路
 
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Lvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukongLvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukong
 
了解应用服务器
了解应用服务器了解应用服务器
了解应用服务器
 
分布式缓存与队列
分布式缓存与队列分布式缓存与队列
分布式缓存与队列
 
Track2 -刘继伟--openstack in gamewave
Track2 -刘继伟--openstack in gamewaveTrack2 -刘继伟--openstack in gamewave
Track2 -刘继伟--openstack in gamewave
 

高可用