如何在起搏器中设置资源粘性?

我正在玩红帽的高可用性附加,一切似乎工作正常,但我有一个问题:

每当我重新启动一个节点7test2 ,资源组g1迁移到7test1 (devise),然后当7test2回来在线资源组g1迁移回来,就像它有某种粘性或东西。

 [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 ~]# 

如何在起搏器中设置资源粘性?

您可以设置resource-stickiness的值,这是一个资源元选项,用于指定资源优选保留在原始位置(默认值为0)的资源数量,该值指定给定的资源或组:

# pcs resource meta resource_id resource-stickiness=100

例如:

# 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)

要显示特定群集属性的当前值,请使用以下命令。

 pcs property list --all 

要显示特定群集属性的当前值,请使用以下命令。

 pcs property show property 

要设置群集属性的值,请使用下面的pcs命令。

 pcs property set property=value