Available backends:
libvirt 0.1
Available listeners:
multicast 1.2
Listener modules are responsible for accepting requests
from fencing clients.
Listener module [multicast]:
The multicast listener module is designed for use environments
where the guests and hosts may communicate over a network using
multicast.
The multicast address is the address that a client will use to
send fencing requests to fence_virtd.
Multicast IP Address [225.0.0.12]:
Using ipv4 as family.
Multicast IP Port [1229]:
Setting a preferred interface causes fence_virtd to listen only
on that interface. Normally, it listens on all interfaces.
In environments where the virtual machines are using the host
machine as a gateway, this *must* be set (typically to virbr0).
Set to 'none' for no interface.
Interface [virbr0]: br0 如果网卡接口没问题可以不改
The key file is the shared key information which is used to
authenticate fencing requests. The contents of this file must
be distributed to each physical host and virtual machine within
a cluster.
Key File [/etc/cluster/fence_xvm.key]: (需要生成)
Backend modules are responsible for routing requests to
the appropriate hypervisor or management layer.
Backend module [libvirt]:
Configuration complete.
=== Begin Configuration ===
backends {
libvirt {
uri = "qemu:///system";
}
}
listeners {
multicast {
port = "1229";
family = "ipv4";
interface = "br0";
address = "225.0.0.12";
key_file = "/etc/cluster/fence_xvm.key";
}
节点观察跑服务的节点多出一个IP,
测试删掉上面的非关键资源,观察日志
ip addr del dev eth1 10.10.10.100/24
Tail /var/log/cluster/rgmanager.log
Clustat status
clustat status
Cluster Status for tempcluster @ Tue Feb 21 16:35:34 2017
Member Status: Quorate
Member Name ID Status
------ ---- ---- ------
rheld5 1 Online, rgmanager
rhel5f 2 Online, Local, rgmanager
rhel47 3 Online, rgmanager
Service Name Owner (Last) State
------- ---- ----- ------ -----
service:name rhel5f started [P]
service:nfs_service rheld5 started
service:sambaservice rhel47 started
提交失败,,看日志
[root@rhel5f ~]# tail /var/log/cluster/qdiskd.log
Feb 22 18:51:24 qdiskd Quorum disk timings are too slow for configured token timeout
Feb 22 18:51:24 qdiskd * Totem Token timeout: 10000ms
Feb 22 18:51:24 qdiskd * Min. Master recovery time: 63000ms
Feb 22 18:51:24 qdiskd Please set token timeout to at least 66000ms
Feb 22 18:51:24 qdiskd Configuration failed
Feb 22 18:51:27 qdiskd Quorum disk timings are too slow for configured token timeout
Feb 22 18:51:27 qdiskd * Totem Token timeout: 10000ms
Feb 22 18:51:27 qdiskd * Min. Master recovery time: 63000ms
Feb 22 18:51:27 qdiskd Please set token timeout to at least 66000ms
Feb 22 18:51:27 qdiskd Configuration failed
Qdisk总时间为存储的1.3被,cman的时间应该为qdisk的1.7被
Cman默认与qdisk通讯10秒
Man cman 搜索token
修改配置文件vim /etc/cluster/cluster.conf
在cman下添加该行,此处数值为qdisk的1.7被
重启系统
文件系统多出两行,
测试一: 其中一个节点做防火墙测试其效果
Iptables -t filter -A INPUT -s 上文所提到网关地址 -j DROP
查看日志和虚拟机状态
测试二:节点不能对仲裁磁盘读写入(多节点时,测试到只剩下一个节点)
直接down 网卡测试
看日志,服务器状态