起搏器:禁止停止节点上的资源

我有一个slave-ip资源,我想在正常的操作下在一个2节点的PostgreSQL集群中定位到我的从服务器上,以作为只读目的。

一切正常,直到从机节点上的pgsql服务的故障点。 slave-ip资源仍然分配给我的奴隶:

Master/Slave Set: pgsql-master [pgsql] Masters: [ pgsql01-test.internal.helloworld ] Stopped: [ pgsql02-test.internal.helloworld ] master-ip (ocf::heartbeat:IPaddr2): Started pgsql01-test.internal.helloworld slave-ip (ocf::heartbeat:IPaddr2): Started pgsql02-test.internal.helloworld 

我的约束如下:

 pcs constraint colocation add master-ip with master pgsql-master pcs constraint colocation add slave-ip with slave pgsql-master score=0 [root@pgsql01-test run]# pcs constraint Location Constraints: Resource: master-ip Enabled on: pgsql01-test.internal.helloworld (score:0) Enabled on: pgsql02-test.internal.helloworld (score:0) Ordering Constraints: start master-ip then promote pgsql-master (kind:Mandatory) Colocation Constraints: master-ip with pgsql-master (score:INFINITY) (rsc-role:Started) (with-rsc-role:Master) slave-ip with pgsql-master (score:0) (rsc-role:Started) (with-rsc-role:Slave) 

我试过这个,但是不起作用:

 pcs constraint colocation add slave-ip with stopped pgsql-master score=-INFINITY