[Pacemaker] Question about multiple instance_attributes
Andrei Borzenkov
arvidjaar at gmail.com
Fri Apr 10 06:09:01 UTC 2015
On Fri, Apr 10, 2015 at 8:22 AM, Kazunori INOUE
<kazunori.inoue3 at gmail.com> wrote:
> Hi,
>
> I defined multiple instance_attributes [*].
> * http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/Pacemaker_Explained/_using_rules_to_control_resource_options.html
> Although it expected that start_opt="-p 5441 ..." would be used on vm1
> and vm2, it wasn't so.
>
> # pacemakerd -F
> Pacemaker 1.1.12 (Build: 3e93bc1)
>
> # cibadmin -Q
> <primitive id="prmPostgreSQLDB" class="ocf" provider="heartbeat"
> type="pgsql">
> <instance_attributes id="prmPostgreSQLDB-instance_attributes">
> <rule score="3" boolean-op="or"
> id="prmPostgreSQLDB-instance_attributes-rule">
> <expression attribute="#uname" operation="eq" value="vm1"
> id="prmPostgreSQLDB-instance_attributes-rule-expression"/>
> <expression attribute="#uname" operation="eq" value="vm2"
> id="prmPostgreSQLDB-instance_attributes-rule-expression-0"/>
> </rule>
> <nvpair name="start_opt" value="-p 5441 -h 192.168.201.140"
> id="prmPostgreSQLDB-instance_attributes-start_opt"/>
> <nvpair name="pgport" value="5441"
> id="prmPostgreSQLDB-instance_attributes-pgport"/>
> </instance_attributes>
> <instance_attributes id="prmPostgreSQLDB-instance_attributes-0">
> <nvpair name="start_opt" value="-p 5449 -h 192.168.201.140"
> id="prmPostgreSQLDB-instance_attributes-0-start_opt"/>
> <nvpair name="pgport" value="5449"
> id="prmPostgreSQLDB-instance_attributes-0-pgport"/>
> (snip)
>
> # hostname
> vm1
> # ps -ax | grep postgres
> 28591 ? S 0:00 /usr/pgsql-9.4/bin/postgres (snip) -p 5449 -h
> 192.168.201.140
>
> Is it a design that boolean-op of "rule" doesn't function?
>
I suspect that your second rule is simply unconditionally applied
because it does not have any rules to evaluate.
More information about the Pacemaker
mailing list