Hello, i have found two problems on the bash script :
/usr/lib/ocf/resource.d/heartbeat/mysql on pacemaker.

Bug #1

The function bellow contains an error :

get_read_only() {
    # Check if read-only is set
    local read_only_state
    read_only_state=`$MYSQL $MYSQL_OPTIONS_REPL \
        -e "SHOW VARIABLES" | grep read_only | awk '{print $2}'`
    if [ "$read_only_state" = "ON" ]; then
        return 0
    else
        return 1
    fi
}

*It doesn't catch the good var read_only, but static var innodb_read_only
which always on OFF. The op monitor fails permanently.*

*Fast Correction :*

get_read_only() {
    # Check if read-only is set
    local read_only_state
    read_only_state=`$MYSQL $MYSQL_OPTIONS_REPL \
        -e "SHOW VARIABLES" | grep -v '_read_only' | grep -v 'read_only_' |
grep 'read_only' | awk '{print $2}'`
    if [ "$read_only_state" = "ON" ]; then
        return 0
    else
        return 1
    fi
}

Bug #2

The function set_master have a problem too. It doesn't set the port in the
SQL request "SET MASTER TO...". Mysql set it on the default port : 3306.

*The function set_master*

[...]
    # Informs the MySQL server of the master to replicate
    # from. Accepts one mandatory argument which must contain the host
    # name of the new master host. The master must either be unchanged
    # from the laste master the slave replicated from, or freshly
    # reset with RESET MASTER.

    ocf_run $MYSQL $MYSQL_OPTIONS_REPL \
        -e "CHANGE MASTER TO MASTER_HOST='$new_master', \
        MASTER_USER='$OCF_RESKEY_replication_user', \
        MASTER_PASSWORD='$OCF_RESKEY_replication_passwd' $master_params"
    rm -f $tmpfile
[...]

*The correction*

[...]
    # Informs the MySQL server of the master to replicate
    # from. Accepts one mandatory argument which must contain the host
    # name of the new master host. The master must either be unchanged
    # from the laste master the slave replicated from, or freshly
    # reset with RESET MASTER.

    ocf_run $MYSQL $MYSQL_OPTIONS_REPL \
        -e "CHANGE MASTER TO MASTER_HOST='$new_master',
MASTER_PORT='$OCF_RESKEY_replication_port', \
        MASTER_USER='$OCF_RESKEY_replication_user', \
        MASTER_PASSWORD='$OCF_RESKEY_replication_passwd' $master_params"
    rm -f $tmpfile
[...]


Have a good day.

-- 
*Arnaud Legrand*

Em@il : arnaud.legr...@ariadnext.com


*AriadNEXT* - *Secure Scan & Sign*
80 av des Buttes de Coësmes
35700 RENNES - FRANCE
*http://www.ariadnext.com <http://www.ariadnext.com>*

-- 
 

<https://idcheck.io/fr/home?utm_source=AxtEmailFooter&utm_medium=mail>

Ce message et toutes les pièces jointes sont confidentiels et établis à 
l'intention exclusive de son ou ses destinataires. Si vous avez reçu ce 
message par erreur, merci d'en avertir immédiatement l'émetteur et de 
détruire le message. Toute modification, édition, utilisation ou diffusion 
non autorisée est interdite. L'émetteur décline toute responsabilité au 
titre de ce message s'il a été modifié, déformé, falsifié, infecté par un 
virus ou encore édité ou diffusé sans autorisation.

This message and any attachments are confidential and intended for the 
named addressee(s) only. If you have received this message in error, please 
notify immediately the sender, then delete the message. Any unauthorized 
modification, edition, use or dissemination is prohibited. The sender shall 
not be liable for this message if it has been modified, altered, falsified, 
infected by a virus or even edited or disseminated without authorization.

_______________________________________________
Linux-HA mailing list is closing down.
Please subscribe to us...@clusterlabs.org instead.
http://clusterlabs.org/mailman/listinfo/users
_______________________________________________
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha

Reply via email to