码迷,mamicode.com
首页 > 其他好文 > 详细

(?)企业部分之HA集群

时间:2016-06-15 08:05:59      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:clustat   fence   ha集群   cluster   

需要三台纯净的虚拟机,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挂掉,自动重启

clustatserver2  h

 

echo c > /proc/sysrq-trigger##崩溃

server1挂掉,自动重启

clustatserver2  h

(?)企业部分之HA集群

标签:clustat   fence   ha集群   cluster   

原文地址:http://wjl19940429.blog.51cto.com/11354210/1789368

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!