以下为集群 ytt_mgr 的状态,节点 1 为主,节点 2 和节点 3 为从。
MySQL debian-ytt1:3306 ssl ytt Py > c1 = dba.get_cluster('ytt_mgr');
MySQL debian-ytt1:3306 ssl ytt Py > c1.status();
{
"clusterName": "ytt_mgr",
"defaultReplicaSet": {
"name": "default",
"primary": "debian-ytt1:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"debian-ytt1:3306": {
"address": "debian-ytt1:3306",
"mode": "R/W",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.20"
},
"debian-ytt2:3306": {
"address": "debian-ytt2:3306",
"mode": "R/O",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.20"
},
"debian-ytt3:3306": {
"address": "debian-ytt3:3306",
"mode": "R/O",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.20"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "debian-ytt1:3306"
}