Discussion:
[Pacemaker] Question about multiple instance_attributes
Andrei Borzenkov
2015-04-10 06:09:01 UTC
Permalink
On Fri, Apr 10, 2015 at 8:22 AM, Kazunori INOUE
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.

_______________________________________________
Pacemaker mailing list: ***@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
Kazunori INOUE
2015-04-13 09:32:04 UTC
Permalink
Post by Andrei Borzenkov
On Fri, Apr 10, 2015 at 8:22 AM, Kazunori INOUE
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.
That is, is 'boolean-op="or"' invalid?
Post by Andrei Borzenkov
_______________________________________________
http://oss.clusterlabs.org/mailman/listinfo/pacemaker
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
_______________________________________________
Pacemaker mailing list: ***@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
Andrei Borzenkov
2015-04-13 10:53:16 UTC
Permalink
On Mon, Apr 13, 2015 at 12:32 PM, Kazunori INOUE
Post by Kazunori INOUE
Post by Andrei Borzenkov
On Fri, Apr 10, 2015 at 8:22 AM, Kazunori INOUE
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.
That is, is 'boolean-op="or"' invalid?
That's not what I said. Your second rule does not have any expressions
(sorry, I meant that) so it is always applied unconditionally.

_______________________________________________
Pacemaker mailing list: ***@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
Kazunori INOUE
2015-04-14 09:54:07 UTC
Permalink
Post by Andrei Borzenkov
On Mon, Apr 13, 2015 at 12:32 PM, Kazunori INOUE
Post by Kazunori INOUE
Post by Andrei Borzenkov
On Fri, Apr 10, 2015 at 8:22 AM, Kazunori INOUE
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.
That is, is 'boolean-op="or"' invalid?
That's not what I said. Your second rule does not have any expressions
(sorry, I meant that) so it is always applied unconditionally.
I had mistaken the position which writes score="3". I obtained the
result expected by the next config.

<primitive id="prmPostgreSQLDB" class="ocf" provider="heartbeat"
type="pgsql">
<instance_attributes score="3" id="prmPostgreSQLDB-instance_attributes">
<rule score="INFINITY" 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"/>

Thanks.
Post by Andrei Borzenkov
_______________________________________________
http://oss.clusterlabs.org/mailman/listinfo/pacemaker
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
_______________________________________________
Pacemaker mailing list: ***@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

Loading...