Host to never be the master

40 views
Skip to first unread message

Carmen Sarlo

unread,
Aug 17, 2015, 12:53:56 PM8/17/15
to PRM-discuss
I would like to setup a host to be a backup host. This host is underpowered and I would like it to never be the master. When I add this location I receive a syntax error.
My location:

location never_be_the_master ms_mysql rule $role="Master" -inf: #uname eq db3


Error:

ERROR: syntax in score near <=Master>


My config:

node db1 \

  attributes p_mysql_mysql_master_IP="x.x.x.34"

node db2 \

  attributes p_mysql_mysql_master_IP="x.x.x.35" standby="off"

node db3 \

  attributes standby="on"

primitive db_reader_vip1 ocf:heartbeat:IPaddr2 \

  params ip="x.x.x.101" nic="eth1" cidr_netmask="24" \

  op monitor interval="10s" \

  meta target-role="Started"

primitive db_reader_vip2 ocf:heartbeat:IPaddr2 \

  params ip="x.x.x.102" nic="eth1" cidr_netmask="24" \

  op monitor interval="10s" \

  meta target-role="Started"

primitive db_writer_vip ocf:heartbeat:IPaddr2 \

  params ip="x.x.x.100" nic="eth1" cidr_netmask="24" \

  op monitor interval="10s" \

  meta target-role="Started"

primitive p_mysql ocf:percona:mysql \

  params config="/etc/mysql/my.cnf" pid="/var/run/mysqld/mysqld.pid" socket="/var/run/mysqld/mysqld.sock" replication_user="repluser" replication_passwd="************" max_slave_lag="60" evict_outdated_slaves="false" binary="/usr/sbin/mysqld" test_user="testuser" test_passwd="************" \

  op monitor interval="5s" role="Master" ocf_check_level="1" \

  op monitor interval="3s" role="Slave" ocf_check_level="1" \

  op start interval="0" timeout="180s" \

  op stop interval="0" timeout="180s" \

  meta target-role="Started"

ms ms_mysql p_mysql \

  meta master-max="1" master-node-max="1" clone-max="3" clone-node-max="1" notify="true" globally-unique="false" target-role="Master" is-managed="true"

location loc-no-db-reader-vip-1 db_reader_vip1 \

  rule $id="loc-no-db-reader-vip-1-rule" -inf: readable lt 1

location loc-no-db-reader-vip2 db_reader_vip2 \

  rule $id="loc-no-db-reader-vip2-rule" -inf: readable lt 1

colocation db_writer_vip_on_master inf: db_writer_vip ms_mysql:Master

order ms_mysql_promote_before_vip inf: ms_mysql:promote db_writer_vip:start

property $id="cib-bootstrap-options" \

  dc-version="1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c" \

  cluster-infrastructure="openais" \

  expected-quorum-votes="3" \

  stonith-enabled="false" \

  no-quorum-policy="ignore"

property $id="mysql_replication" \

  p_mysql_REPL_INFO="x.x.x.34|master-bin.000002|107"



Thanks in advance for any help.



Yves Trudeau

unread,
Aug 17, 2015, 1:36:54 PM8/17/15
to prm-d...@googlegroups.com
Hi,
   some of the syntax in Pacemaker have changed, try removing the $ in front of role.  When I have a minute, I'll start a Pacemaker cluster and test this.

Regards,

Yves

--
You received this message because you are subscribed to the Google Groups "PRM-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prm-discuss...@googlegroups.com.
To post to this group, send email to prm-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/prm-discuss.
For more options, visit https://groups.google.com/d/optout.

Carmen Sarlo

unread,
Aug 17, 2015, 5:50:12 PM8/17/15
to PRM-discuss
When I remove $ in front of role, crm does not like that. 

element rule: Relax-NG validity error : Expecting an element expression, got nothing

element rule: Relax-NG validity error : Element rule failed to validate content

element rule: Relax-NG validity error : Element rsc_location failed to validate content

element rsc_location: Relax-NG validity error : Element constraints has extra content: rsc_location

element configuration: Relax-NG validity error : Invalid sequence in interleave

element cib: Relax-NG validity error : Element cib failed to validate content

crm_verify[18653]: 2015/08/17_21:47:58 ERROR: main: CIB did not pass DTD/schema validation

Errors found during check: config not valid

Yves Trudeau

unread,
Aug 18, 2015, 10:20:07 PM8/18/15
to prm-d...@googlegroups.com
Hi,
   can you tell me the version of Pacemaker you are using.

Regards,

Yves

Carmen Sarlo

unread,
Aug 19, 2015, 10:24:37 AM8/19/15
to PRM-discuss

Pacemaker 1.1.6

Corosync 1.4.2

Carmen Sarlo

unread,
Aug 20, 2015, 9:37:51 AM8/20/15
to PRM-discuss
If I edit the cib by using crm configure edit, it's fine. When I try to add the location by the command line, there is where it fails. For now I am ok with this. I wanted a way to add the location with a config tool like chef or puppet.
Reply all
Reply to author
Forward
0 new messages