heartbeat v2实现高可用集群 html
#v2版本文本信息变为基于xml文件/var/lib/heartbeat/crm/*cib.xml格式)再也不是v1版本的那种基于haresources文本文件保存集群资源信息了 #可是咱们并不会写xml文件,此时 v2版本的/usr/lib64/heartbeat/haresources2cib.py 能够实现将v1版的haresource文本文件转化为xml格式,无需其余操做---很贴心哦 #基于v1版本的配置,咱们须要从新配置 heartbeat;再也不须要将haresources2cib.py 来转换文本了 咱们直接使用v2版本的图形配置接口heartbeat-GUI来配置高可用集群
资源规划node
web server:node1 node2 vip: 192.168.1.200 httpd nfs: /www/htdocs, /var/www/html
高可用集群的配置
linux
node1上操做 (1)关闭服务: # service heartbeat stop 关闭node1 # ssh node2.linux.com 'service heartbeat stop' 关闭node2 (2)编辑配置文件 # cd /etc/ha.d # vim ha.cf 添加以下内容 crm on (3)将配置信息通告给node2 # /user/lib64/hearbeat/ha_propagate 使用通告工具将信息同步到node2上---前提node1,node2 必须ssh无需密码 (4)各个节点安装heartbeat-gui # yum -y install pygtk2-libglade 解决依赖关系 # yum -y install heartbeat-gui-2.1.4-12.el6.x86_64.rpm 拿yum工具来安装,解决依赖关系 (5)重启各个节点heartbeat # service heartbeat restart # ssh node2.linux.com 'service heartbeat restart' (6)查看端口监听状况 # ss -ntl mgmtd进程 *.5560 (7)配置用户hacluster密码 ------在 node1上配置,就在上边配置hacluster用户密码 # passwd hacluster 输入密码 (8)启动程序 # hb_gui &
登陆后的界面web
添加一个组资源(组资源是一个逻辑单元,还需在逻辑单元中添加各个资源) vim
添加第1个资源vipbash
继续添加第2个资源 httpdssh
添加第3个资源Filesystemide
启动组资源工具
客户端web测试测试
客户端再次web测试
总结,使用v2版本的 GUI图形界面工具已经成功实现HA高可用集群。
PS:水平有限,若有疑问请留言