Hi Benjamin,

Wow! It rocks!! Thanks!!!

As information the lsb dummy mysql ha script:

case "$1" in
 start)
   exit 0
   ;;
 stop)
   exit 0
   ;;
 status)
   status mysqld
   if [ $? -eq "0" ]; then
       /usr/sbin/attrd_updater -n mysql_running -d 3s -v 1
       exit 0
   else
       /usr/sbin/attrd_updater -n mysql_running -d 3s -v 0
       exit 3
   fi
   ;;
 *)
   echo $"Usage: $0 {start|stop|status} (start|stop faked)"
   exit 1
esac

--
Markus


Benjamin Lawetz schrieb:
Hi Markus,
        I ran into the same problem. Didn't find any better way than to
modify the monitoring script of mysql and add in the case of a failure:

/usr/sbin/attrd_updater -n mysql_running -d 5s -v 0

And in the case of a success:

/usr/sbin/attrd_updater -n mysql-mod_running -d 5s -v 1

The running the monitor script as a clone:

       <clone id="mysql">
         <instance_attributes id="mysql">
           <attributes>
             <nvpair id="mysql-clone_node_max" name="clone_node_max"
value="1"/>
           </attributes>
         </instance_attributes>
         <primitive id="mysql-child" provider="heartbeat" class="ocf"
type="mysql">
           <operations>
             <op id="mysql-child-monitor" name="monitor" interval="20s"
timeout="40s" prereq="nothing">
               <instance_attributes id="mysql-child-monitor-attr">
               </instance_attributes>
             </op>
             <op id="mysql-child-start" name="start" prereq="nothing"/>
           </operations>
         </primitive>
       </clone>

And then had a constraint:

       <rsc_location rsc="group_1" id="cli-stop2-group_1">
         <rule score="-INFINITY" id="cli-stop2-rule-group_1">
           <expression operation="lte" value="0" id="cli-stop2-expr-group_1"
attribute="mysql_running"/>
         </rule>
       </rsc_location>

This will run the monitor on every node and set the score to -INFINITY for
the node where mysql fails.

If mysql comes back online though, the "mysql_running" will be set to "1"
but I don't think it will trigger a recalculation of the scores. Haven't
figured out yet how to cause this.


Hope this helps

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to