List:Cluster« Previous MessageNext Message »
From:Jonas Oreland Date:January 3 2005 6:04pm
Subject:Re: ndbd and ndb_mgmd process termination?
View as plain text  
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.
SIGTERM is not graceful node shutdown.
It will clean up resources, but not wait for running transactions but 
rather abort them directly.

The only way to perform "transaction graceful" shutdown is via ndb_mgmd

shell> echo "5 stop" | ndb_mgm

/Jonas

> 
> 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 ;)
> 
> 
> 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<--
> 
> 


-- 
Jonas Oreland, Software Engineer
MySQL AB, www.mysql.com
Thread
ndbd and ndb_mgmd process termination?Martin P├íla3 Jan
  • Re: ndbd and ndb_mgmd process termination?Jonas Oreland3 Jan
  • Re: ndbd and ndb_mgmd process termination?Tomas Ulin11 Jan