Martin Pála wrote:
>Hello,
>
>i have a question to the ndbd and ndb_mgmd process termination. I want to shutdown
> these process gracefuly before the machine is stopped to prevent the data loss. When i'll
> use pkill or killall command to send SIGTERM to the processes, they exit, however the
> question is:
>
> is SIGTERM handling in these processes equivalent to the "<id> stop" command in
> management console?
> (i.e. will the node exit gracefuly or is here any diferrence between this and normal
> shutdown?)
>
>
no, they will not shutdown as gracefully as with shutdown. Note that
this has the potential of shutting down the whole cluster.
>The optional script-based solution which i though about could be to get main IP
> address of the machine's name, use "show" console command to get related node id's and
> call "<id> stop" for each of them, however this is more complicated then simple
> signal ;)
>
>
>
I would recommend looking for the ndb_<id>.pid file locally on the
machine and do one ndb_mgm -e "<id> stop" per local id. This will also
check for possible resulting cluster shutdown and disallow the stop.
BR,
Tomas
>The scripts are simple and look like:
>
>1.) /etc/init.d/mysql.backend
>--8<--
>#!/bin/sh
>#
># MySQL backend storage node startup script
>#
>
>MYSQL_BASE=/usr/local/mysql
>
>case $1 in
> 'start')
> $MYSQL_BASE/bin/ndbd
> ;;
> 'stop')
> pkill ndbd
> ;;
> 'restart')
> $0 stop
> $0 start
> ;;
> *)
> echo "Usage: $0 start|stop|restart"
> exit 1
> ;;
>esac
>--8<--
>
>
>2.) /etc/init.d/mysql.management
>--8<--
>#!/bin/sh
>#
># MySQL management node startup script
>#
>
>MYSQL_BASE=/usr/local/mysql
>
>case $1 in
> 'start')
> $MYSQL_BASE/bin/ndb_mgmd -f /mysql/cluster/config.ini
> ;;
> 'stop')
> pkill ndb_mgmd
> ;;
> 'restart')
> $0 stop
> $0 start
> ;;
> *)
> echo "Usage: $0 start|stop|restart"
> exit 1
> ;;
>esac
>--8<--
>
>
>
>