21.3.6 Safe Shutdown and Restart of NDB Cluster (original) (raw)

21.3.6 Safe Shutdown and Restart of NDB Cluster

To shut down the cluster, enter the following command in a shell on the machine hosting the management node:

$> ndb_mgm -e shutdown

The -e option here is used to pass a command to the ndb_mgm client from the shell. The command causes the ndb_mgm,ndb_mgmd, and any ndbd orndbmtd processes to terminate gracefully. Any SQL nodes can be terminated using mysqladmin shutdown and other means. On Windows platforms, assuming that you have installed the SQL node as a Windows service, you can use SC STOP_servicename_ or NET STOP servicename.

To restart the cluster on Unix platforms, run these commands:

$> ndb_mgmd -f /var/lib/mysql-cluster/config.ini  
$> ndbd  
$> mysqld_safe &  

On Windows platforms, assuming that you have installed all NDB Cluster processes as Windows services using the default service names (seeSection 21.3.2.4, “Installing NDB Cluster Processes as Windows Services”), you can restart the cluster as follows:

C:\> SC START ndb_mgmd  
C:\> SC START ndbd  
C:\> SC START mysql  

In a production setting, it is usually not desirable to shut down the cluster completely. In many cases, even when making configuration changes, or performing upgrades to the cluster hardware or software (or both), which require shutting down individual host machines, it is possible to do so without shutting down the cluster as a whole by performing arolling restart of the cluster. For more information about doing this, seeSection 21.6.5, “Performing a Rolling Restart of an NDB Cluster”.