MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
restart_cluster_rolling.inc
1 ##
2 ## Restarts a NDB cluster by rolling node restart
3 ##
4 ## Parameters:
5 ## $waiter_timeout_start - How long wo tait for a single node to start, default from restart_node.inc
6 ## $waiter_timeout_stop - How long to wait for a single node to stop, default from restart_node.inc
7 ## $MTR_NDB_FIRST_NDBD_NODEID - The first node id of the NDBD data nodes
8 ## $MTR_NDB_LAST_NDBD_NODEID - The last node id of the NDBD data nodes
9 ##
10 ## This include file has as a prerequisite that the NDBD node ids is in a numbered range without
11 ## holes which starts with MTR_NDB_FIRST_NDBD_NODEID and ends with $MTR_NDB_LAST_NDBD_NODEID.
12 ##
13 ## The last two parameters are normally provided by
14 ## --source suite/ndb/include/ndb_info.inc
15 ##
16 ## In addition, $NDB_CONNECTSTRING, $NDB_MGM, $NDB_TOOLS_DIR and $NDB_TOOLS_OUTPUT
17 ## must be set (they are normally proivided by MTR).
18 ##
19 
20 --echo # Rolling system restart from node $MTR_NDB_FIRST_NDBD_NODEID to node $MTR_NDB_LAST_NDBD_NODEID:
21 --append_file $NDB_TOOLS_OUTPUT
22 # Rolling system restart:
23 EOF
24 
25 --let $ndb_node_id= $MTR_NDB_LAST_NDBD_NODEID
26 while (`SELECT $ndb_node_id >= $MTR_NDB_FIRST_NDBD_NODEID`) {
27  --echo # Restarting node $ndb_node_id as part of rolling system restart
28  --source suite/ndb/include/restart_node.inc
29  --dec $ndb_node_id
30 }
31 --let $ndb_node_id=
32 --exec $NDB_MGM -e "show" >> $NDB_TOOLS_OUTPUT