rolling-restart.sh

Comments

2 comments

  • Avatar
    Johan

    Hi Brian,

    We do like this for ip addresses:

    serverid=`echo ${host} | cut -d . -f 4`

    so that  echo "192.168.56.101" | cut -d . -f 4     --->  serverid=101

    and for hostnames:
    serverid=`\${basedir}/bin/resolveip -s \$host | cut -d . -f 4` 

    So, that uses mysql's resolveip to get the ip of the hostname, and the take the last 3 numbers of the IP.

    It is set at installation in bootstrap.sh   and in start-mysqld.sh  (located in the same dir as rolling-restart.sh)

    I hope this helps!

    BR
    johan 

    0
    Comment actions Permalink
  • Avatar
    Brian D

    Hi Johan,

    I have found that your start-mysqld.sh script does not perform the same check that bootstrap.sh does.  Bootstrap checks if the hostname is numeric and then sets the serverid.  start-mysqld.sh does not perform the same check.

     

    The line : serverid=`${bindir}//resolveip -s ${host} | cut -d . -f 4`

    I have replaced with the following:

     

    if [ -n "$host" ];

    then

    serverid=`echo ${host} | cut -d . -f 4`

    else

    serverid=`${bindir}//resolveip -s ${host} | cut -d . -f 4`

    fi

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk