MySQL localhost JS > cluster.status()
{
"clusterName": "testcluster",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql-node1:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"mysql-node1:3306": {
"address": "mysql-node1:3306",
"instanceErrors": [
"WARNING: The replication recovery account in use by the instance is not stored in the metadata. Use Cluster.rescan() to update the metadata.",
"WARNING: Detected unused recovery accounts: mysql_innodb_cluster_2, mysql_innodb_cluster_3. Use Cluster.rescan() to clean up."
],
"memberRole": "PRIMARY",
"mode": "R/W",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
},
"mysql-node2:3306": {
"address": "mysql-node2:3306",
"instanceErrors": [
"WARNING: Instance is not managed by InnoDB cluster. Use cluster.rescan() to repair.",
"ERROR: Invalid or missing information of Group Replication's network address in metadata. Use Cluster.rescan() to update the metadata.",
"ERROR: Metadata for this instance does not match X plugin port reported by instance (metadata=, actual=mysql-node2:33060). Use rescan() to update the metadata."
],
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
},
"mysql-node3:3306": {
"address": "mysql-node3:3306",
"instanceErrors": [
"WARNING: Instance is not managed by InnoDB cluster. Use cluster.rescan() to repair.",
"ERROR: Invalid or missing information of Group Replication's network address in metadata. Use Cluster.rescan() to update the metadata.",
"ERROR: Metadata for this instance does not match X plugin port reported by instance (metadata=, actual=mysql-node3:33060). Use rescan() to update the metadata."
],
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "mysql-node1:3306"
}
直接在mysql shell的 java script 模式,使用rescan() 解决
MySQL localhost JS > var cluster=dba.getCluster();
MySQL localhost JS > cluster.rescan();
Rescanning the cluster...
Result of the rescanning operation for the 'testcluster' cluster:
{
"metadataConsistent": true,
"name": "testcluster",
"newTopologyMode": null,
"newlyDiscoveredInstances": [
{
"host": "mysql-node3:3306",
"member_id": "ab92788d-329e-11f1-a354-525402a712ea",
"name": null,
"version": "8.4.8"
},
{
"host": "mysql-node2:3306",
"member_id": "ae1b6411-32ff-11f1-8436-525402a73951",
"name": null,
"version": "8.4.8"
}
],
"unavailableInstances": [],
"updatedInstances": []
}
A new instance 'mysql-node3:3306' was discovered in the cluster.
Would you like to add it to the cluster metadata? [Y/n]: Y
Adding instance to the cluster metadata...
The instance 'mysql-node3:3306' was successfully added to the cluster metadata.
A new instance 'mysql-node2:3306' was discovered in the cluster.
Would you like to add it to the cluster metadata? [Y/n]: Y
Adding instance to the cluster metadata...
The instance 'mysql-node2:3306' was successfully added to the cluster metadata.
Fixing incorrect recovery account 'mysql_innodb_cluster_3' in instance 'mysql-node1:3306'
Fixing incorrect recovery account 'mysql_innodb_cluster_2' in instance 'mysql-node3:3306'
MySQL localhost JS > cluster.status()
{
"clusterName": "testcluster",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql-node1:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"mysql-node1:3306": {
"address": "mysql-node1:3306",
"memberRole": "PRIMARY",
"mode": "R/W",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
},
"mysql-node2:3306": {
"address": "mysql-node2:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
},
"mysql-node3:3306": {
"address": "mysql-node3:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.4.8"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "mysql-node1:3306"
}
|