Eu tenho um recurso slave-ip que gostaria de localizar em meu escravo sob operação normal em um cluster PostgreSQL de 2 nós para fins somente leitura.
Tudo está bem, até o ponto de falha do serviço pgsql no nó escravo; o recurso escravo-ip continua sendo atribuído ao meu escravo:
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
Minhas restrições são as seguintes:
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)
Eu tentei isso, mas não funciona:
pcs constraint colocation add slave-ip with stopped pgsql-master score=-INFINITY