2 ## Restarts a single NDB data node
5 ## $ndb_node_id - The node to be restarted
6 ## $waiter_timeout_start - How long wo tait for a single node to start, default 120 seconds
7 ## $waiter_timeout_stop - How long to wait for a single node to stop, default 60 seconds
9 ## In addition, $NDB_CONNECTSTRING, $NDB_MGM, $NDB_TOOLS_DIR and $NDB_TOOLS_OUTPUT
10 ## must be set (they are normally proivided by MTR).
14 if (`SELECT LENGTH(
'$waiter_timeout_start') = 0`) {
15 let $waiter_timeout_start= 120;
17 if (`SELECT LENGTH(
'$waiter_timeout_stop') = 0`) {
18 let $waiter_timeout_stop= 60;
21 --echo # Restarting node $ndb_node_id, timeouts: start: $waiter_timeout_start seconds, stop: $waiter_timeout_stop seconds:
23 --append_file $NDB_TOOLS_OUTPUT
24 # Restarting random node, stopping part:
26 --exec $NDB_MGM -e
"show" >> $NDB_TOOLS_OUTPUT
27 --exec $NDB_MGM -e
"$ndb_node_id restart -n" >> $NDB_TOOLS_OUTPUT
28 --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring=
"$NDB_CONNECTSTRING" --wait-nodes=$ndb_node_id --not-started --timeout=$waiter_timeout_stop >> $NDB_TOOLS_OUTPUT
30 --append_file $NDB_TOOLS_OUTPUT
31 # Restarting random node, starting part:
33 --exec $NDB_MGM -e
"show" >> $NDB_TOOLS_OUTPUT
34 --exec $NDB_MGM -e
"$ndb_node_id start" >> $NDB_TOOLS_OUTPUT
35 --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring=
"$NDB_CONNECTSTRING" --timeout=$waiter_timeout_start >> $NDB_TOOLS_OUTPUT
36 --exec $NDB_MGM -e
"show" >> $NDB_TOOLS_OUTPUT