我正在使用以下教程(https://www.sqlshack.com/deploy-mysql-innodb-clusters-for-high-availability/)设置 InnoDB 集群。到目前为止一切正常:
- MySQL 服务器安装
- dba.configureLocalInstance()
- dba.createCluster() - 在主节点上
但现在我到了最后一步,即向集群添加一个实例。但这不起作用,因为第二个实例似乎无法通过端口 33061 访问主节点。
防火墙未激活 - 通过端口 33061(通过 Telnet)从 Node2 到 Node1 的连接也有效。所有三台服务器都位于专用网络中。
发出命令“cluster.addInstance("");”时收到以下错误消息:
MySQL xx-database-01:33060+ ssl JS > cluster.addInstance("dbadmin@xx-database-02");
NOTE: The target instance 'xx-database-02:3306' has not been pre-provisioned (GTID set is empty). The Shell is unable to decide whether incremental state recovery can correctly provision it.
The safest and most convenient way to provision a new instance is through automatic clone provisioning, which will completely overwrite the state of 'xx-database-02:3306' with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'.
The incremental state recovery may be safely used if you are sure all updates ever executed in the cluster were done with GTIDs enabled, there are no purged transactions and the new instance contains the same GTID set as the cluster or a subset of it. To use this method by default, set the 'recoveryMethod' option to 'incremental'.
Please select a recovery method [C]lone/[I]ncremental recovery/[A]bort (default Clone):
Validating instance configuration at xx-database-02:3306...
This instance reports its own address as xx-database-02:3306
Instance configuration is suitable.
NOTE: Group Replication will communicate with other members using 'xx-database-02:33061'. Use the localAddress option to override.
A new instance will be added to the InnoDB cluster. Depending on the amount of
data on the cluster this might take from a few seconds to several hours.
Adding instance to the cluster...
ERROR: Unable to start Group Replication for instance 'xx-database-02:3306'.
The MySQL error_log contains the following messages:
2021-01-27 13:29:39.527418 [System] [MY-013587] Plugin group_replication reported: 'Plugin 'group_replication' is starting.'
2021-01-27 13:29:39.562511 [System] [MY-010597] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2021-01-27 13:29:39.870120 [Error] [MY-011735] Plugin group_replication reported: '[GCS] Error on opening a connection to xx-database-01:33061 on local port: 33061.'
2021-01-27 13:29:39.970214 [Error] [MY-011735] Plugin group_replication reported: '[GCS] Error on opening a connection to xx-database-01:33061 on local port: 33061.'
Cluster.addInstance: Group Replication failed to start: MySQL Error 3092 (HY000): xx-database-02:3306: The server is not configured properly to be an active member of the group. Please see more details on error log. (RuntimeError)
cluster.status() 返回以下内容:
MySQL xx-database-01:33060+ ssl JS > cluster.status();
{
"clusterName": "xx_cluster",
"defaultReplicaSet": {
"name": "default",
"primary": "xx-database-01:3306",
"ssl": "REQUIRED",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"topology": {
"xx-database-01:3306": {
"address": "xx-database-01:3306",
"mode": "R/W",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.22"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "xx-database-01:3306"
}
MySQL xx-database-01:33060+ ssl JS >
所有节点 (3) 都运行带有 MySQL 8 的 Ubuntu 20。所有节点上的配置属性“bind-address”设置为“0.0.0.0”。也可以建立从 node1 到 node2 的 mysql 连接,反之亦然。
我已经花了几个小时试图找出错误的原因,但不幸的是还没有找到。
提前致谢!