大网数据广告活动
服务器运维问答

linux pacemaker - prevent split brain

· 52CE 我爱测

since using CentOS 7, we switched from a regular heartbeat setup to pacemker. Mainly we have IP resources that are active on one node and switch to a second node if a failover happens. Also we execute some scripts in case of a fa…

问题原文

原帖链接 · sebkoe · CC BY-SA 3.0

since using CentOS 7, we switched from a regular heartbeat setup to pacemker.

Mainly we have IP resources that are active on one node and switch to a second node if a failover happens. Also we execute some scripts in case of a failover. Nothing special.

For resources to always start on the primary node, i use

pcs constraint location Cluster_IP prefers server1=master-server

I also use

pcs resource defaults resource-stickiness=INFINITY

to prevent resources moving back after failover.

This works fine for me, if the master fails (hardware failure for example).

Since its not a problem for me if the failover takes some time, i would like to implement some kind of delay in case of a short split brain.

Before doing anything, the slave should wait ~2 Minutes, before it takes over, in case the master is reachable again in this ~2 Minutes.

I was wondering, what would be the best way to do it?

已采纳解答

原帖链接 · Matt Kereczman · CC BY-SA 3.0

I've never set a token timeout in Corosync to anything above 10 seconds, but you could try increasing/setting the token value in your corosync.conf to 120000 (120 seconds in milliseconds). token should be defined in the totem{} section of your corosync.conf; man corosync.conf for more detail.

That should prevent Corosync from declaring a node dead for 120s when the network flakes out.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-03-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。