高可用架构由两个核心部分组成,一个是心跳检测,判断服务器是否正常运行;一个是资源转移,用来将公共资源在正常服务器和故障服务器之间搬动。两个结合起来使用,可以实现对高可用架构的自动管理。
整个运行模式就是心跳检测不断的在网络中检测各个指定的设备是否能够正常响应,如果一旦发生设备故障,就由资源转移功能进行应用的切换,以继续提供服务。
corosync提供集群的信息层(messaging layer)的功能,传递心跳信息和集群事务信息,多台机器之间通过组播的方式监测心跳
pacemaker工作在资源分配层,提供资源管理器的功能,并以crmsh这个资源配置的命令接口来配置资源
心跳检测是用来检测服务器是否还在提供服务,只要出现异常不能提供服务了,就认为它挂掉了。
当检测出服务器挂掉之后,就要对服务资源进行转移。
CoroSync是运行于心跳层的开源软件。
PaceMaker是运行于资源转移层的开源软件。
使用corosync监控心跳,pacemaker时先资源转移,crmsh实现集群资源配置
使用fence检查节点健康状况,实行跳电保护
一、Haproxy
server1:172.25.53.2
server2:172.25.53.3
[root@server2 ~]
[root@server2 mnt]
haproxy-1.6.11.tar.gz
[root@server2 mnt]
[root@server2 mnt]
[root@server2 ~]
[root@server2 x86_64]
haproxy-1.6.11-1.x86_64.rpm
[root@server2 x86_64]
Preparing...
1:haproxy
[root@server2 x86_64]
haproxy-1.6.11-1.x86_64.rpm 所制作的rpm包
[root@server2 x86_64]
[root@server2 x86_64]
[root@server2 ~]
anaconda-ks.cfg nginx-1.10.1.tar.gz nginx-sticky-module-ng.tar.gz
install.log nginx-1.14.0 rpmbuild
install.log.syslog nginx-1.14.0.tar.gz
nginx-1.10.1 nginx-sticky-module-ng
[root@server2 ~]
[root@server2 mnt]
crmsh-1.2.6-0.rc2.2.1.x86_64.rpm haproxy-1.6.11.tar.gz
[root@server2 mnt]
[root@server2 mnt]
crmsh-1.2.6-0.rc2.2.1.x86_64.rpm haproxy-1.6.11 haproxy-1.6.11.tar.gz
[root@server2 mnt]
[root@server2 haproxy-1.6.11]
CHANGELOG doc include Makefile src VERDATE
contrib ebtree LICENSE README SUBVERS VERSION
CONTRIBUTING examples MAINTAINERS ROADMAP tests
[root@server2 haproxy-1.6.11]
./examples/haproxy.spec
[root@server2 haproxy-1.6.11]
[root@server2 examples]
acl-content-sw.cfg debug2html init.haproxy
auth.cfg debugfind option-http_proxy.cfg
check errorfiles seamless_reload.txt
check.conf haproxy.init ssl.cfg
content-sw-sample.cfg haproxy.spec stats_haproxy.sh
debug2ansi haproxy.vim transparent_proxy.cfg
[root@server2 examples]
[root@server2 examples]
[root@server2 haproxy]
haproxy.cfg
[root@server2 haproxy]
[root@server