<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 6, 2010, at 9:44 PM, ch huang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">thanks for quick reply ,i do have monit on mysql ,mysql datadir is on drbd ,as u see ,the drbd is defined as resource,but as your way,it sames just monit&nbsp; one host's service ,if the service is unavariable,pacemaker will try to restart it on this host,but i want&nbsp; mysql start on another backup host<br></blockquote><div><br></div><div><br></div><div>No, you are not, this is your config, right?</div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; "><div><div class="h5">&gt; primitive mysqld lsb:mysqld</div></div></blockquote></div></blockquote><br></div><div>no monitor operation is defined</div><div><br></div><div><br></div><div><br></div><br><blockquote type="cite">
<br><div class="gmail_quote">On Mon, Jun 7, 2010 at 9:30 AM, Vadym Chepkov <span dir="ltr">&lt;<a href="mailto:vchepkov@gmail.com">vchepkov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; ">
<div><div></div><div class="h5"><br>
On Jun 6, 2010, at 9:15 PM, ch huang wrote:<br>
<br>
&gt; mysql is running ,and crm status output is<br>
&gt;<br>
&gt; ============<br>
&gt; Last updated: Sat Jun &nbsp;5 09:48:58 2010<br>
&gt; Stack: openais<br>
&gt; Current DC: PRIM - partition with quorum<br>
&gt; Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7<br>
&gt; 2 Nodes configured, 2 expected votes<br>
&gt; 2 Resources configured.<br>
&gt; ============<br>
&gt;<br>
&gt; Online: [ PRIM SEC ]<br>
&gt;<br>
&gt; &nbsp;Resource Group: mysql<br>
&gt; &nbsp; &nbsp; &nbsp;fs_mysql &nbsp; (ocf::heartbeat:Filesystem): &nbsp; &nbsp;Started PRIM<br>
&gt; &nbsp; &nbsp; &nbsp;ip_mysql &nbsp; (ocf::heartbeat:IPaddr2): &nbsp; &nbsp; &nbsp; Started PRIM<br>
&gt; &nbsp; &nbsp; &nbsp;mysqld &nbsp; &nbsp; (lsb:mysqld): &nbsp; Started PRIM<br>
&gt; &nbsp;Master/Slave Set: ms_drbd_mysql<br>
&gt; &nbsp; &nbsp; &nbsp;Masters: [ PRIM ]<br>
&gt; &nbsp; &nbsp; &nbsp;Slaves: [ SEC ]<br>
&gt;<br>
&gt; and i finished the mysql by<br>
&gt;<br>
&gt; #service mysqld stop<br>
&gt; Stopping MySQL: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ &nbsp;OK &nbsp;]<br>
&gt; # service mysqld status<br>
&gt; mysqld is stopped<br>
&gt;<br>
&gt; but in the crm status output , mysql still in running ,i do not understand why?<br>
&gt;<br>
&gt; ============<br>
&gt; Last updated: Sat Jun &nbsp;5 09:48:58 2010<br>
&gt; Stack: openais<br>
&gt; Current DC: PRIM - partition with quorum<br>
&gt; Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7<br>
&gt; 2 Nodes configured, 2 expected votes<br>
&gt; 2 Resources configured.<br>
&gt; ============<br>
&gt;<br>
&gt; Online: [ PRIM SEC ]<br>
&gt;<br>
&gt; &nbsp;Resource Group: mysql<br>
&gt; &nbsp; &nbsp; &nbsp;fs_mysql &nbsp; (ocf::heartbeat:Filesystem): &nbsp; &nbsp;Started PRIM<br>
&gt; &nbsp; &nbsp; &nbsp;ip_mysql &nbsp; (ocf::heartbeat:IPaddr2): &nbsp; &nbsp; &nbsp; Started PRIM<br>
&gt; &nbsp; &nbsp; &nbsp;mysqld &nbsp; &nbsp; (lsb:mysqld): &nbsp; Started PRIM<br>
&gt; &nbsp;Master/Slave Set: ms_drbd_mysql<br>
&gt; &nbsp; &nbsp; &nbsp;Masters: [ PRIM ]<br>
&gt; &nbsp; &nbsp; &nbsp;Slaves: [ SEC ]<br>
&gt;<br>
&gt; and here is my configure<br>
&gt;<br>
&gt; # crm<br>
&gt; crm(live)# configure<br>
&gt; crm(live)configure# show<br>
&gt; node PRIM<br>
&gt; node SEC<br>
&gt; primitive drbd_mysql ocf:linbit:drbd \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; params drbd_resource="r1" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; op monitor interval="15s"<br>
&gt; primitive fs_mysql ocf:heartbeat:Filesystem \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; params device="/dev/drbd/by-res/r1" directory="/drbddata/" fstype="ext3"<br>
&gt; primitive ip_mysql ocf:heartbeat:IPaddr2 \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; params ip="192.168.76.227" nic="eth0"<br>
&gt; primitive mysqld lsb:mysqld<br>
&gt; group mysql fs_mysql ip_mysql mysqld<br>
&gt; ms ms_drbd_mysql drbd_mysql \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"<br>
&gt; colocation mysql_on_drbd inf: mysql ms_drbd_mysql:Master<br>
&gt; order mysql_after_drbd inf: ms_drbd_mysql:promote mysql:start<br>
&gt; property $id="cib-bootstrap-options" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; no-quorum-policy="ignore" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; stonith-enabled="false" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; expected-quorum-votes="2" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; dc-version="1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; cluster-infrastructure="openais" \<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; default-action-timeout="240s"<br>
&gt;<br>
<br>
<br>
</div></div>First of all, nothing is monitored by default, you need to enabled monitor operation.<br>
Second, you were advised do not use lsb, use ocf resource agent instead:<br>
<br>
in sql create a simple monitoring database<br>
<br>
create database cluster;<br>
use cluster;<br>
create table monitor (int i);<br>
insert into monitor values(1);<br>
grant select on cluster.monitor to monitor@localhost identified by 'monitor';<br>
<br>
it's just so the monitor script can do a select.<br>
<br>
Then somewhat long primitive definition:<br>
<br>
primitive mysqld ocf:heartbeat:mysql \<br>
 &nbsp; &nbsp; &nbsp; &nbsp;params binary="/usr/bin/mysqld_safe" config="/drbddata/mysql/etc/my.cnf" enable_creation="0" datadir="/drbddata/mysql/data" \<br>
 &nbsp; &nbsp; &nbsp; &nbsp;user="mysql" test_user="monitor" test_passwd="monitor" test_table="cluster.monitor" \<br>
 &nbsp; &nbsp; &nbsp; &nbsp;op monitor start-delay="60s" interval="300s"<br>
<br>
Enjoy<br>
<font color="#888888"><br>
Vadym<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org/" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
</div></div></blockquote></div><br>
_______________________________________________<br>Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br><a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br><br>Project Home: <a href="http://www.clusterlabs.org">http://www.clusterlabs.org</a><br>Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br></blockquote></div><br></body></html>