发酵饲料
Creating a Session to 'root@db-node01:3000'
Classic Session successfully established. No default schema selected.
mysql-js> var cluster = ateCluster('testCluster'); # 创建⼀个 cluster,命名为 'testCluster' A new InnoDB cluster will be created on instance 'root@db-node01:3000'. Creating InnoDB cluster 'testCluster' on 'root@db-node01:3000'...
Adding
Cluster successfully created. Use Cluster.addInstance() to add MySQL instances.
At least 3 instances are needed for the cluster to be able to withstand up to
one server failure.
如上的信息, 如果创建成功, 则会输出的信息中会有类似“Cluster successfully created.”的语句 mysql-js> cluster.status();
{
"clusterName": "testCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "db-node01:3000",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"db-node01:3000": {
"address": "db-node01:3000",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
}
}
}虚假记忆
}
mysql-js> cluster.addInstance('root@db-node02:3000');
A new instance will be added to the InnoD
B cluster. Depending on the amount of
data on the cluster this might take from a few seconds to several hours.
Please provide the password for 'root@db-node02:3000':
财智老板通Adding instance to the cluster ... The instance 'root@db-node02:3000' was successfully added to the cluster.
mysql-js> cluster.addInstance('root@db-node03:3000');
A new instance will be added to the InnoD
B cluster. Depending on the amount of
data on the cluster this might take from a few seconds to several hours.
Please provide the password for 'root@db-node03:3000':
Adding instance to the cluster ...
The instance 'root@db-node03:3000' was successfully added to the cluster.
mysql-js> cluster.status();
{
"clusterName": "testCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "db-node01:3000",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"db-node01:3000": {
"address": "db-node01:3000",海音寺潮五郎
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"db-node02:3000": {
cnf
"address": "db-node02:3000",
"mode": "R/O",
"readReplicas": {},