所以,我在一个vlan中有两个测试服务器。
srv1
eth1 10.10.10.11
eth2 10.20.10.11
srv2
eth1 10.10.10.12
eth2 10.20.10.12
Cluster VIP - 10.10.10.100具有两个接口的Corosync配置:
rrp_mode: passive
interface {
ringnumber: 0
bindnetaddr: 10.10.10.0
mcastaddr: 226.94.1.1
mcastport: 5405
}
interface {
ringnumber: 1
bindnetaddr: 10.20.10.0
mcastaddr: 226.94.1.1
mcastport: 5407
}起搏器配置:
# crm configure show
node srv1
node srv2
primitive cluster-ip ocf:heartbeat:IPaddr2 \
params ip="10.10.10.100" cidr_netmask="24" \
op monitor interval="5s"
primitive ha-nginx lsb:nginx \
op monitor interval="5s"
location prefer-srv-2 ha-nginx 50: srv2
colocation nginx-and-cluster-ip +inf: ha-nginx cluster-ip
property $id="cib-bootstrap-options" \
dc-version="1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c" \
cluster-infrastructure="openais" \
expected-quorum-votes="2" \
no-quorum-policy="ignore" \
stonith-enabled="false"状态:
# crm status
============
Last updated: Thu Jan 29 13:40:16 2015
Last change: Thu Jan 29 12:47:25 2015 via crmd on srv1
Stack: openais
Current DC: srv2 - partition with quorum
Version: 1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c
2 Nodes configured, 2 expected votes
2 Resources configured.
============
Online: [ srv1 srv2 ]
cluster-ip (ocf::heartbeat:IPaddr2): Started srv2
ha-nginx (lsb:nginx): Started srv2戒指:
# corosync-cfgtool -s
Printing ring status.
Local node ID 185207306
RING ID 0
id = 10.10.10.11
status = ring 0 active with no faults
RING ID 1
id = 10.20.10.11
status = ring 1 active with no faults而且,如果我做了srv2# ifconfig eth1 down,起搏器仍然在eth2上工作,这没什么。但是nginx在10.10.10.100 (因为eth1 down,ya)和pacemeker说,一切都很好。
但是,我希望在srv1的eth1死后,nginx移动到srv2。
那么,我能做什么呢?
发布于 2015-01-29 18:21:31
pingd资源被精确设计为在连接丢失时故障转移节点。您可能会在集群实验室wiki上找到一个非常简短的示例:http://clusterlabs.org/wiki/Example_configurations#Set_向上_平德
有些不相关,但我在过去见过使用ifconfig down测试连接丢失的问题。我强烈鼓励您使用iptable来减少流量,以测试连接性的丢失。
发布于 2020-09-16 13:14:04
由于多种原因,ping监视器对此场景是不够的。你做什么平?在linux中,当接口关闭时,本地ip仍然会触发(这是不好的,不应该是这样),但是如果您平了默认网关呢?集群之外的一些事情可能会导致默认网关ping丢失,几乎所有这些都与集群本地网络连接的健康无关。
起搏器需要有一种方法来监控网络接口的上下状态。这是本地网络问题的最佳指示。我还没有找到任何方法来做到这一点,据我所知,这是起搏器簇中的一个可怕的缺陷。
https://serverfault.com/questions/663394
复制相似问题