start cluster [--initial|-i] [--skip-init=process_id_list] cluster_name
process_id_list:
process_id[, process_id[, ...]]
此命令启动名为 的集群
cluster_name
,如本例所示:
mcm> start cluster mycluster;
+------------------------------+
| Command result |
+------------------------------+
| Cluster started successfully |
+------------------------------+
1 row in set (45.37 sec)
为了使命令成功,命令中命名的集群必须已经存在;否则命令将失败并显示错误Cluster cluster_name
not defined,如下所示:
mcm> list sites;
+--------+------+-------+------------------------------+
| Site | Port | Local | Hosts |
+--------+------+-------+------------------------------+
| mysite | 1862 | Local | tonfisk,flundra,grindval,haj |
+--------+------+-------+------------------------------+
1 row in set (1.72 sec)
mcm> list clusters mysite;
+-----------+-----------+
| Cluster | Package |
+-----------+-----------+
| mycluster | mypackage |
+-----------+-----------+
1 row in set (1.70 sec)
mcm> start cluster yourcluster;
ERROR 5001 (00MGR): Cluster yourcluster not defined
此外,集群必须尚未运行,如下所示:
mcm> show status --cluster mycluster;
+-----------+-------------------+---------+
| Cluster | Status | Comment |
+-----------+-------------------+---------+
| mycluster | fully operational | |
+-----------+-------------------+---------+
1 row in set (0.01 sec)
mcm> start cluster mycluster;
ERROR 5005 (00MGR): Cluster mycluster is running
在导入完成之前,无法启动为导入创建的集群。有关更多信息,请参阅第 4.4.1 节,“create cluster
命令”和第 3.5 节,“将 MySQL NDB 集群导入 MySQL 集群管理器”。
该--initial
选项(简称:)
-i
会导致发生以下情况:
所有集群数据节点都像 在其上使用过一样启动,这意味着所有数据节点都擦除其数据并以干净的数据节点文件系统启动。 以前存储在集群中的表丢失了。
start process
--initial
NDB
For MySQL Cluster Manager 1.4.3 and later: All cluster SQL nodes are started as if
start process
--initial
have been used on them, which means MySQL Cluster Manager rebuilds the mysqld data directory with the mysqld--initialize-insecure
command for MySQL 5.7 and with the mysql_install_db command for MySQL 5.6. However, the node's data directory must be empty, or the reinitialization will not be attempted.--skip-init
要跳过任何 SQL 节点的重新初始化,请使用=选项 列出它们的进程 ID(如果有多个,则用逗号分隔)process_id_list
,例如:mcm> start cluster --initial --skip-init=50,51 mycluster;
该
--skip-init
选项只接受 SQL 节点 ID 作为其参数;它不能用于跳过数据节点的初始化。
在正常情况下,仅当您不希望保留其任何数据(并希望干净启动)或打算将集群从备份恢复到已知的良好状态时,才应使用此选项启动集群(请参阅
第 4.7.4 节,“restore cluster
命令”)。您还应该注意,
当与;一起使用时, mcm客户端
不会打印任何特殊警告。命令立即执行。
--initial
start cluster
有关创建集群备份的信息,请参阅
第 4.7.2 节“backup cluster
命令”。如果您需要知道哪些备份可用(如果有),请使用list
backups
.