[Pacemaker] i stop mysql service but the crm status is still runing

Vadym Chepkov vchepkov at gmail.com
Sun Jun 6 21:30:59 EDT 2010


On Jun 6, 2010, at 9:15 PM, ch huang wrote:

> mysql is running ,and crm status output is
> 
> ============
> Last updated: Sat Jun  5 09:48:58 2010
> Stack: openais
> Current DC: PRIM - partition with quorum
> Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7
> 2 Nodes configured, 2 expected votes
> 2 Resources configured.
> ============
> 
> Online: [ PRIM SEC ]
> 
>  Resource Group: mysql
>      fs_mysql   (ocf::heartbeat:Filesystem):    Started PRIM
>      ip_mysql   (ocf::heartbeat:IPaddr2):       Started PRIM
>      mysqld     (lsb:mysqld):   Started PRIM
>  Master/Slave Set: ms_drbd_mysql
>      Masters: [ PRIM ]
>      Slaves: [ SEC ]
> 
> and i finished the mysql by 
> 
> #service mysqld stop
> Stopping MySQL:                                            [  OK  ]
> # service mysqld status
> mysqld is stopped
> 
> but in the crm status output , mysql still in running ,i do not understand why?
> 
> ============
> Last updated: Sat Jun  5 09:48:58 2010
> Stack: openais
> Current DC: PRIM - partition with quorum
> Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7
> 2 Nodes configured, 2 expected votes
> 2 Resources configured.
> ============
> 
> Online: [ PRIM SEC ]
> 
>  Resource Group: mysql
>      fs_mysql   (ocf::heartbeat:Filesystem):    Started PRIM
>      ip_mysql   (ocf::heartbeat:IPaddr2):       Started PRIM
>      mysqld     (lsb:mysqld):   Started PRIM
>  Master/Slave Set: ms_drbd_mysql
>      Masters: [ PRIM ]
>      Slaves: [ SEC ]
> 
> and here is my configure
> 
> # crm
> crm(live)# configure
> crm(live)configure# show
> node PRIM
> node SEC
> primitive drbd_mysql ocf:linbit:drbd \
>         params drbd_resource="r1" \
>         op monitor interval="15s"
> primitive fs_mysql ocf:heartbeat:Filesystem \
>         params device="/dev/drbd/by-res/r1" directory="/drbddata/" fstype="ext3"
> primitive ip_mysql ocf:heartbeat:IPaddr2 \
>         params ip="192.168.76.227" nic="eth0"
> primitive mysqld lsb:mysqld
> group mysql fs_mysql ip_mysql mysqld
> ms ms_drbd_mysql drbd_mysql \
>         meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
> colocation mysql_on_drbd inf: mysql ms_drbd_mysql:Master
> order mysql_after_drbd inf: ms_drbd_mysql:promote mysql:start
> property $id="cib-bootstrap-options" \
>         no-quorum-policy="ignore" \
>         stonith-enabled="false" \
>         expected-quorum-votes="2" \
>         dc-version="1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7" \
>         cluster-infrastructure="openais" \
>         default-action-timeout="240s"
> 


First of all, nothing is monitored by default, you need to enabled monitor operation.
Second, you were advised do not use lsb, use ocf resource agent instead:

in sql create a simple monitoring database

create database cluster;
use cluster;
create table monitor (int i);
insert into monitor values(1);
grant select on cluster.monitor to monitor at localhost identified by 'monitor';

it's just so the monitor script can do a select.

Then somewhat long primitive definition:

primitive mysqld ocf:heartbeat:mysql \
	params binary="/usr/bin/mysqld_safe" config="/drbddata/mysql/etc/my.cnf" enable_creation="0" datadir="/drbddata/mysql/data" \
        user="mysql" test_user="monitor" test_passwd="monitor" test_table="cluster.monitor" \
	op monitor start-delay="60s" interval="300s"

Enjoy

Vadym



More information about the Pacemaker mailing list