Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual ndb_mgm_restart4()

Description.  Like the other ndb_mgm_restart*() functions, this function restarts one or more data nodes. Like ndb_mgm_restart2(), it can be used to cause an initial restart, waiting restart, and immediate (forced) restart on one or more NDB Cluster data nodes; like ndb_mgm_stop3() it provides for a way to check to see whether disconnection is required prior to stopping a node. In addition, it is possible to force the node to restart even if this would cause a restart of the cluster.


int ndb_mgm_restart4
      NdbMgmHandle handle,
      int          number,
      const int*   list,
      int          initial
      int          nostart,
      int          abort,
      int          force,
      int*         disconnect

Parameters.  ndb_mgm_restart4() takes 7 parameters:

  • An NdbMgmHandle.

  • The number of nodes to be stopped. Use 0 to stop all of the data nodes in the cluster.

  • A list of the node IDs of the nodes to be stopped.

  • If initial is true (1), then each node undergoes an initial restart—that is, its file system is removed.

  • If nostart is true, then the nodes are not actually started, but instead are left ready for a start command.

  • If abort is true, then the nodes are forced to restart immediately without performing a graceful restart.

  • The value of force determines the action to be taken in the event that the loss of a given node due to restarting would cause an incomplete cluster.

    1 causes the node—and the entire cluster—to be restarted in such cases, 0 means that the node will not be restarted.

    Setting force equal to 1 also makes it possible to restart a node even while other nodes are starting. (Bug #58451)

  • If disconnect returns 1 (true), this means the you must disconnect before you can apply the command to restart. For example, disconnecting is required when stopping the management server to which the handle is connected.

Return value.  The number of nodes actually restarted; -1 on failure.