Discussion:
[Pacemaker] CRM property mysql_replication
Michal Fiala
2015-07-15 10:58:09 UTC
Permalink
Hi,

I am running 2 node cluster with simple configuration for mysql
replication. Resource agent mysql (ocf:heartbeat:mysql) saves
replication info into property mysql_replication but this property is is
unknown by crm shell when changing configuration.

using distro Gentoo and package versions:

sys-cluster/pacemaker-1.1.12-r2
sys-cluster/corosync-2.3.4-r1
sys-cluster/resource-agents-3.9.6
sys-cluster/crmsh-2.1.4

(The same problem exists also on Ubuntu LTS 14.04, package version are
similar to Gentoo's)

crm configure show

# nodes
node 1: rajdev2
node 2: rajdev3
# primitives
primitive pri_mysqld mysql \
params binary="/usr/sbin/mysqld" client_binary="/usr/bin/mysql"
config="/etc/mysql/my.cnf" log="/var/log/mysql/mysqld.err"
datadir="/databaze" user=mysql group=mysql
pid="/var/run/mysqld/mysqld.pid" socket="/var/run/mysqld/mysqld.sock"
replication_user=repl replication_passwd="foobar" \
op start interval=0 timeout=300s \
op stop interval=0 timeout=1800s \
op monitor interval=5s role=Master \
op monitor interval=6s role=Slave \
meta migration-threshold=1
# MSL
ms msl_mysqld pri_mysqld \
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1
notify=true target-role=Started
# Property
property cib-bootstrap-options: \
stonith-enabled=false \
no-quorum-policy=ignore \
symmetric-cluster=true \
maintenance-mode=false \
last-lrm-refresh=1436956096 \
dc-version=1.1.12-561c4cf \
cluster-infrastructure=corosync
property mysql_replication: \
pri_mysqld_REPL_INFO="rajdev2|db-bin.000025|120"
rsc_defaults rsc-options: \
resource-stickiness=100
op_defaults op-options: \
timeout=30s

Try to change an attribute in crm configuration (for example change
timeout value)

$ crm
crm(live)# configure edit
# change timeout or something else and quit
ERROR: mysql_replication: attribute pri_mysqld_REPL_INFO does not exist
Edit or discard changes (yes to edit, no to discard) (y/n)?

So I have to delete "property mysql_replication", change what I need,
stop a start resource msl_mysqld (this step add property
mysql_replication back)

Please, where can be a problem?

Thanks

Regards

Michal

_______________________________________________
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
Dejan Muhamedagic
2015-07-17 07:46:02 UTC
Permalink
Hi,
Post by Michal Fiala
Hi,
I am running 2 node cluster with simple configuration for mysql
replication. Resource agent mysql (ocf:heartbeat:mysql) saves
replication info into property mysql_replication but this property is is
unknown by crm shell when changing configuration.
sys-cluster/pacemaker-1.1.12-r2
sys-cluster/corosync-2.3.4-r1
sys-cluster/resource-agents-3.9.6
sys-cluster/crmsh-2.1.4
(The same problem exists also on Ubuntu LTS 14.04, package version are
similar to Gentoo's)
crm configure show
# nodes
node 1: rajdev2
node 2: rajdev3
# primitives
primitive pri_mysqld mysql \
params binary="/usr/sbin/mysqld" client_binary="/usr/bin/mysql"
config="/etc/mysql/my.cnf" log="/var/log/mysql/mysqld.err"
datadir="/databaze" user=mysql group=mysql
pid="/var/run/mysqld/mysqld.pid" socket="/var/run/mysqld/mysqld.sock"
replication_user=repl replication_passwd="foobar" \
op start interval=0 timeout=300s \
op stop interval=0 timeout=1800s \
op monitor interval=5s role=Master \
op monitor interval=6s role=Slave \
meta migration-threshold=1
# MSL
ms msl_mysqld pri_mysqld \
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1
notify=true target-role=Started
# Property
property cib-bootstrap-options: \
stonith-enabled=false \
no-quorum-policy=ignore \
symmetric-cluster=true \
maintenance-mode=false \
last-lrm-refresh=1436956096 \
dc-version=1.1.12-561c4cf \
cluster-infrastructure=corosync
property mysql_replication: \
pri_mysqld_REPL_INFO="rajdev2|db-bin.000025|120"
rsc_defaults rsc-options: \
resource-stickiness=100
op_defaults op-options: \
timeout=30s
Try to change an attribute in crm configuration (for example change
timeout value)
$ crm
crm(live)# configure edit
# change timeout or something else and quit
ERROR: mysql_replication: attribute pri_mysqld_REPL_INFO does not exist
Edit or discard changes (yes to edit, no to discard) (y/n)?
So I have to delete "property mysql_replication", change what I need,
stop a start resource msl_mysqld (this step add property
mysql_replication back)
Please, where can be a problem?
The attribute is not listed in the PE meta-data and therefore
considered an error. You can make crmsh less strict like this:

# crm option set core.check_mode relaxed

It'll still print the error, but your changes are going to be
committed.

Given that it is common practice for some RA to stuff its
attributes into cluster properties, this should be handled
better. Probably by not running the PE meta-data check for
property elements which are not "cib-bootstrap-options".

Thanks,

Dejan
Post by Michal Fiala
Thanks
Regards
Michal
_______________________________________________
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
Vladislav Bogdanov
2015-07-17 08:32:56 UTC
Permalink
17.07.2015 10:46, Dejan Muhamedagic wrote:
[...]
Post by Dejan Muhamedagic
The attribute is not listed in the PE meta-data and therefore
# crm option set core.check_mode relaxed
It'll still print the error, but your changes are going to be
committed.
Given that it is common practice for some RA to stuff its
attributes into cluster properties, this should be handled
better. Probably by not running the PE meta-data check for
property elements which are not "cib-bootstrap-options".
+1
I run patched version of crmsh (with meta checks disabled) for many years.


_______________________________________________
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
Michal Fiala
2015-07-22 06:57:08 UTC
Permalink
Hi,

it works, thank you.

M.
Post by Vladislav Bogdanov
[...]
Post by Dejan Muhamedagic
The attribute is not listed in the PE meta-data and therefore
# crm option set core.check_mode relaxed
It'll still print the error, but your changes are going to be
committed.
Given that it is common practice for some RA to stuff its
attributes into cluster properties, this should be handled
better. Probably by not running the PE meta-data check for
property elements which are not "cib-bootstrap-options".
+1
I run patched version of crmsh (with meta checks disabled) for many years.
_______________________________________________
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...