Checking slave status

Comments

3 comments

  • Avatar
    Johan

    Hi

    Here is an example to read the properties and print them out:

    https://gist.github.com/freddielunchbird/d0eef43a5dfa6e643b9979e19eda2250

    To shutdown a node, i must check with the devs; i could not find this command implemented. But it is a very small command to add.

     


    BR
    johan

     

  • Avatar
    Arifin

    Hello Johan,

    Thank you for good response. So basically it's possible to execute something like this "service mysql stop" after replication failure?

     

  • Avatar
    Johan

    Hi,

     

    yes it could be by using the 'system' function on the host  object.

     

    function main()
    {
    var hosts = cluster::hosts();
    var host = hosts[0];
    var retval;
     
    retval = host.system("ls -lha /home");
    if (!retval["success"])
    {
    error("ERROR: ", retval["errorMessage"]);
    }
     
    print("Result: ", retval["result"]);
    return retval["success"];
    }

Please sign in to leave a comment.

Powered by Zendesk