1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
| #在我执行强制恢复集群命令后查看状态如下: MySQL host01:3306 ssl JS > cluster.status() { "clusterName": "myCluster", "defaultReplicaSet": { "name": "default", "primary": "host01:3306", "ssl": "REQUIRED", "status": "OK_NO_TOLERANCE_PARTIAL", "statusText": "Cluster is NOT tolerant to any failures. 2 members are not active.", "topology": { "host01:3306": { "address": "host01:3306", "memberRole": "PRIMARY", "mode": "R/W", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.32" }, "host02:3306": { "address": "host02:3306", "memberRole": "SECONDARY", "mode": "n/a", "readReplicas": {}, "role": "HA", "shellConnectError": "MySQL Error 2003: Could not open connection to 'host02:3306': Can't connect to MySQL server on 'host02:3306' (113)", "status": "(MISSING)" }, "host03:3306": { "address": "host03:3306", "memberRole": "SECONDARY", "mode": "n/a", "readReplicas": {}, "role": "HA", "shellConnectError": "MySQL Error 2003: Could not open connection to 'host03:3306': Can't connect to MySQL server on 'host03:3306' (113)", "status": "(MISSING)" } }, "topologyMode": "Single-Primary" }, "groupInformationSourceMember": "host01:3306" } MySQL host01:3306 ssl JS > cluster.re rejoinInstance() removeInstance() removeRouterMetadata() rescan() resetRecoveryAccountsPassword() #此处尝试 重新加入实例 MySQL host01:3306 ssl JS > cluster.rejoinInstance("host02:3306") ERROR: Unable to connect to the target instance 'host02:3306'. Please verify the connection settings, make sure the instance is available and try again. Cluster.rejoinInstance: Could not open connection to 'host02:3306': Can't connect to MySQL server on 'host02:3306' (113) (MySQL Error 2003) #上面提示不能连接 是我忘记了关闭防火墙 MySQL host01:3306 ssl JS > cluster.rejoinInstance("host02:3306") Validating instance configuration at host02:3306...
This instance reports its own address as host02:3306
Instance configuration is suitable. Rejoining instance 'host02:3306' to cluster 'myCluster'... #在我关闭防火墙后 再次执行重加入实例命令 然后就卡住了。。。。。。。。。。。。。。 Re-creating recovery account... NOTE: User 'mysql_innodb_cluster_11'@'%' already existed at instance 'host01:3306'. It will be deleted and created again with a new password. y^H
^C^C^C^C^C^C^C
^C^C ^C ^C^C clear ^C^C^C^C # # # 连接断开 连接主机... 连接主机成功 # MySQL host01:3306 ssl JS > var cluster = dba.rebootClusterFromCompleteOutage('myCluster') Restoring the Cluster 'myCluster' from complete outage...
Cluster instances: 'host01:3306' (OFFLINE), 'host02:3306' (OFFLINE), 'host03:3306' (OFFLINE) Waiting for instances to apply pending received transactions... Validating instance configuration at host01:3306...
This instance reports its own address as host01:3306
Instance configuration is suitable. * Waiting for seed instance to become ONLINE... host01:3306 was restored. Validating instance configuration at host02:3306...
This instance reports its own address as host02:3306
Instance configuration is suitable. Rejoining instance 'host02:3306' to cluster 'myCluster'...
Re-creating recovery account... NOTE: User 'mysql_innodb_cluster_11'@'%' already existed at instance 'host01:3306'. It will be deleted and created again with a new password.
* Waiting for the Cluster to synchronize with the PRIMARY Cluster... ** Transactions replicated ############################################################ 100%
The instance 'host02:3306' was successfully rejoined to the cluster.
Validating instance configuration at host03:3306...
This instance reports its own address as host03:3306
Instance configuration is suitable. Rejoining instance 'host03:3306' to cluster 'myCluster'...
Re-creating recovery account... NOTE: User 'mysql_innodb_cluster_12'@'%' already existed at instance 'host01:3306'. It will be deleted and created again with a new password.
* Waiting for the Cluster to synchronize with the PRIMARY Cluster... ** Transactions replicated ############################################################ 100%
The instance 'host03:3306' was successfully rejoined to the cluster.
The Cluster was successfully rebooted.
MySQL host01:3306 ssl JS > cluster.status() { "clusterName": "myCluster", "defaultReplicaSet": { "name": "default", "primary": "host01:3306", "ssl": "REQUIRED", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": { "host01:3306": { "address": "host01:3306", "memberRole": "PRIMARY", "mode": "R/W", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.32" }, "host02:3306": { "address": "host02:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.32" }, "host03:3306": { "address": "host03:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.32" } }, "topologyMode": "Single-Primary" }, "groupInformationSourceMember": "host01:3306" } MySQL host01:3306 ssl JS >
|