rolling-restart.sh
This script seems to be messing up the my.cnf files on my MySQL nodes. Specifically, it is placing an incorrect value for the ServerID attribute. No problems with initial install. Where is this value derived? I've tried tracing it back through the script, but I can't find it. I realize rolling restart just calls start-mysqld.sh IIRC. So the problem probably lies in there. It is placing the text string 'cluster' where a numeric value would normally live.
To get the MySQLD nodes up, I have to manually edit the my.cnf on each of them and swap that 'cluster' string to their respective numerical values.
-
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 -
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
Please sign in to leave a comment.
Comments
2 comments