heartbeat v2实现高可用集群
#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来配置高可用集群
资源规划
web server:node1 node2 vip: 192.168.1.200 httpd nfs: /www/htdocs, /var/www/html
高可用集群的配置
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 &
登录后的界面
添加一个组资源(组资源是一个逻辑单元,还需在逻辑单元中添加各个资源)
添加第1个资源vip
继续添加第2个资源 httpd
添加第3个资源Filesystem
启动组资源
客户端web测试
客户端再次web测试
总结,使用v2版本的 GUI图形界面工具已经成功实现HA高可用集群。
PS:水平有限,如有疑问请留言