需要三台纯净的虚拟机,server3作为
server1:172.25.45.1
server2:172.25.45.2
server3:172.25.45.3
【server1,server2】
1.重新配置yum源
vim dvd.repo
内容
rum repolist
图
2.配置/etc/hosts文件
图
3.yum install -y ricci
4.echo westos | passwd --stdin ricci
5.chkconfig ricci on
/etc/init.d/ricci start
【server3】
1.重新配置yum源
vim dvd.repo
内容
rum repolist
图
2.配置/etc/hosts文件(物理机也需要)
图
3.yum install httpd
/etc/init.d/httpd start
4.yum install -y luci
[root@server3 ~]# rpm -q luci
luci-0.26.0-48.el6.x86_64
/etc/init.d/luci start
Starting saslauthd: [ OK ]
Start luci... [ OK ]
Point your web browser to https://server6.example.com:8084 (or equivalent) to access luci
https://server3.example.com:8084 图
图图图
如果过程中重复创建会报错
解决方法:
rm -rf /etc/cluster/cluster.conf
重启服务(???待验证)
2.fence
【物理机】
yum search fence
yum
fence-virtd.x86_64 : Daemon which handles requests from fence-virt
fence-virtd-libvirt.x86_64 : Libvirt backend for fence-virtd**
fence-virtd-multicast.x86_64 : Multicast listener for fence-virtd**
fence-virtd-serial.x86_64 : Serial VMChannel listener for fence-virtd
fence-virt.x86_64 : A pluggable fencing framework for virtual machines**
(大概要下这三个,,,待验证)
图
yum install fence-virt.x86_64 fence-virtd-multicast.x86_64 fence-virtd-libvirt.x86_64
[root@foundation19 ~]# rpm -qa | grep fence
fence-virtd-libvirt-0.3.0-16.el7.x86_64
fence-virtd-0.3.0-16.el7.x86_64
fence-virtd-serial-0.3.0-16.el7.x86_64
fence-virtd-multicast-0.3.0-16.el7.x86_64
fence-virt-0.3.0-16.el7.x86_64
图
(可能会需要手动建立一个目录 mkdir /etc/cluster)
fence_virtd -c
图
会覆盖/etc/fence_virt.conf
netstat -anulp | grep :1229
图
dd if=/dev/urandom of=fence_xvm.key bs=128 count=1
file fence_xvm.key
图
systemctl restart fence_virtd
scp /etc/cluster/fence_xvm.key root@172.25.45.1:/etc/cluster/
scp /etc/cluster/fence_xvm.key root@172.25.45.2:/etc/cluster/
virsh list(图)
【server1/server2】
clustat
网页
图图图
测试:
【server2】
fence_node server2.example.com ##远程断电server2
3.webfail
【server1/server2】
yum install httpd
echo server1.example.com > index.html
echo server2.example.com > index.html
图图图
测试:
图h(此时是server1)
clusvcadm -r apache -m server2.example.com##访问server2
图h(此时是server2)
/etc/init.d/network stop##关掉server1的网络服务
server1挂掉,自动重启
clustat图 server2 图h
echo c > /proc/sysrq-trigger##崩溃
server1挂掉,自动重启
clustat图 server2 图h
原文地址:http://wjl19940429.blog.51cto.com/11354210/1789368