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

How can I set resource stickiness in pacemaker?

· 52CE 我爱测

I'm playing around with Red Hat's High Availability Add-On, everything seems working fine however I have one issue: Whenever I reboot one of nodes 7test2 , resource group g1 migrates to 7test1 (by design) and then when 7test2 com…

问题原文

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

I'm playing around with Red Hat's High Availability Add-On, everything seems working fine however I have one issue:

Whenever I reboot one of nodes 7test2, resource group g1 migrates to 7test1 (by design) and then when 7test2 comes back online resource group g1 migrates back, it's like it has some sort of stickiness or something.

[root@7test1 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.1 (Maipo)
[root@7test1 ~]# rpm -q pcs 
pcs-0.9.137-13.el7.x86_64
[root@7test1 ~]# pcs status
Cluster name: 7test
Last updated: Thu Apr 23 17:11:10 2015
Last change: Thu Apr 23 17:00:02 2015
Stack: corosync
Current DC: 7test1.uftwf.local (1) - partition with quorum
Version: 1.1.12-a14efad
2 Nodes configured
3 Resources configured


Online: [ 7test1.uftwf.local 7test2.uftwf.local ]

Full list of resources:

 rhevm  (stonith:fence_rhevm):  Started 7test1.uftwf.local 
 Resource Group: g1
     IPaddr (ocf::heartbeat:IPaddr2):   Started 7test2.uftwf.local 
     MailTo (ocf::heartbeat:MailTo):    Started 7test2.uftwf.local 

PCSD Status:
  7test1.uftwf.local: Online
  7test2.uftwf.local: Online

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@7test1 ~]# 

How can I set resource stickiness in pacemaker?

已采纳解答

原帖链接 · Giorgio Bar · CC BY-SA 3.0

You can set the value of resource-stickiness, a resource meta option that indicates how much the resource prefers to stay where it is (the default value is 0) for a given resource or group whith the following command:

# pcs resource meta resource_id resource-stickiness=100

For example:

# pcs resource meta dns_ip resource-stickiness=100

# pcs resource show dns_ip Resource: dns_ip (class=ocf provider=heartbeat type=IPaddr2) Attributes: ip=10.0.0.1 cidr_netmask=24 Meta Attrs: resource-stickiness=100 Operations: start interval=0s timeout=20s (dns_ip-start-timeout-20s)

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

资料来源与适用范围

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

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

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