设置 InnoDB 集群 - 打开连接时出错

问题描述

我正在使用以下教程 (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_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连接,反之亦然。

我已经花了几个小时试图找出错误的原因,但很遗憾没有找到。

提前致谢!

解决方法

这与 https://dba.stackexchange.com/questions/282162/mysql-innodb-cluster-add-instance-issue-with-local-port

中报告和回答的问题相同

您必须配置许可名单。