我遇到了将第二个实例加入 MySQL 复制组的问题。它似乎是通信或超时错误。简而言之,我在第二个节点的日志中看到了这个错误:

"Timeout while waiting for the group communication engine to be ready!"
"The group communication engine is not ready for the member to join. Local port: 33061"

我为建立组而采取的步骤:

1) 首先,我确保在两台服务器之间打开了正确的端口:

作为引用,我使用这四个变量来保护隐私:
  • AA.AAA.AA.A = 我的第一个服务器的公共(public) IP 地址
  • AA.0.0.000 = 我的第一个服务器的私有(private) IP 地址
  • BBB.BBB.BBB.BBB = 我的第二个服务器的公共(public) IP 地址
  • BBB.0.0.000 = 我的第二个服务器的私有(private) IP 地址

  • 第一台服务器位于 Amazon AWS 上,它有一个安全组,在 3306 和 33061 上向 BBB.BBB.BBB.BBB 开放。

    第二台服务器位于私有(private)服务器上,它有一个防火墙,允许来自 3306 和 33061 上的 AA.AAA.AA.A 的流量。

    从第一台服务器,确保我可以访问第二台服务器:
    mysql -u repl -p'XXXXXXXXXXXXX' -h BBB.BBB.BBB.BBB
    telnet BBB.BBB.BBB.BBB 3306
    telnet BBB.BBB.BBB.BBB 33061
    telnet BBB.BBB.BBB.BBB 7777 #Times out, as expected
    

    从第一个服务器,确保我可以进行传出连接:
    curl portquiz.net:3306
    curl portquiz.net:33061
    

    从第二台服务器,确保我访问第二台服务器:
    mysql -u repl -p'XXXXXXXXXXXXX' -h AA.AAA.AA.A
    telnet AA.AAA.AA.A 3306
    telnet AA.AAA.AA.A 33061
    telnet AA.AAA.AA.A 7777 #Times out, as expected
    

    从第二个服务器,确保我可以进行传出连接:
    curl portquiz.net:3306
    curl portquiz.net:33061
    

    这一切似乎都在工作中!

    2)接下来,我使用以下配置在每台服务器上启动 MySQL:

    我的第一个服务器的配置文件:
    [mysqld_safe]
    nice                                    = 0
    socket                                  = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    basedir                                 = /usr
    bind_address                            = 0.0.0.0
    binlog_checksum                         = NONE
    binlog_format                           = ROW
    datadir                                 = /var/lib/mysql
    enforce_gtid_consistency                = ON
    general_log                             = 1
    general_log_file                        = /var/log/mysql/mysql.log
    gtid_mode                               = ON
    key_buffer_size                         = 8388608
    lc_messages_dir                         = /usr/share/mysql
    log_bin                                 = binlog
    log_error                               = /var/log/mysql/error.log
    log_slave_updates                       = ON
    long_query_time                         = 60
    loose-group_replication_allow_local_disjoint_gtids_join= ON
    loose-group_replication_bootstrap_group = OFF
    loose-group_replication_enforce_update_everywhere_checks= ON
    loose-group_replication_group_name      = ZZZZZZ-ZZZZZZ-ZZZZZZ-ZZZZZZ
    loose-group_replication_group_seeds     = AA.0.0.000:33061,BBB.BBB.BBB.BBB:33061
    loose-group_replication_ip_whitelist    = AA.0.0.000,BBB.BBB.BBB.BBB,BBB.0.0.000
    loose-group_replication_local_address   = AA.0.0.000:33061
    loose-group_replication_recovery_use_ssl= 1
    loose-group_replication_single_primary_mode= OFF
    loose-group_replication_ssl_mode        = REQUIRED
    loose-group_replication_start_on_boot   = OFF
    master_info_repository                  = TABLE
    max_allowed_packet                      = 16M
    max_binlog_size                         = 100M
    max_connect_errors                      = 100000000
    pid-file                                = /var/run/mysqld/mysqld.pid
    port                                    = 3306
    relay_log                               = first-server-relay-bin
    relay_log_info_repository               = TABLE
    report_host                             = AA.AAA.AA.A
    server_id                               = 1
    skip_external_locking
    slow_query_log                          = 1
    slow_query_log_file                     = /var/log/mysql/slow_query.log
    socket                                  = /var/run/mysqld/mysqld.sock
    thread_cache_size                       = 8
    thread_stack                            = 192K
    tmpdir                                  = /tmp
    transaction_write_set_extraction        = XXHASH64
    user                                    = mysql
    
    [mysqldump]
    max_allowed_packet                      = 16M
    quick
    quote_names
    
    [mysql]
    no_auto_rehash
    
    [isamchk]
    key_buffer_size                         = 16M
    
    [client]
    port                                    = 3306
    socket                                  = /var/run/mysqld/mysqld.sock
    
    !includedir /etc/mysql/conf.d/
    

    这是我的第二个服务器的配置:
    [mysqld_safe]
    nice                                    = 0
    socket                                  = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    basedir                                 = /usr
    bind_address                            = 0.0.0.0
    binlog_checksum                         = NONE
    binlog_format                           = ROW
    datadir                                 = /var/lib/mysql
    enforce_gtid_consistency                = ON
    general_log                             = 1
    general_log_file                        = /var/log/mysql/mysql.log
    gtid_mode                               = ON
    key_buffer_size                         = 8388608
    lc_messages_dir                         = /usr/share/mysql
    log_bin                                 = binlog
    log_error                               = /var/log/mysql/error.log
    log_slave_updates                       = ON
    long_query_time                         = 60
    loose-group_replication_allow_local_disjoint_gtids_join= ON
    loose-group_replication_bootstrap_group = OFF
    loose-group_replication_enforce_update_everywhere_checks= ON
    loose-group_replication_group_name      = ZZZZZZ-ZZZZZZ-ZZZZZZ-ZZZZZZ
    loose-group_replication_group_seeds     = BBB.0.0.000:33061,AA.AAA.AA.A:33061
    loose-group_replication_ip_whitelist    = BBB.0.0.000,AA.AAA.AA.A,AA.0.0.000
    loose-group_replication_local_address   = BBB.0.0.000:33061
    loose-group_replication_recovery_use_ssl= 1
    loose-group_replication_single_primary_mode= OFF
    loose-group_replication_ssl_mode        = REQUIRED
    loose-group_replication_start_on_boot   = OFF
    master_info_repository                  = TABLE
    max_allowed_packet                      = 16M
    max_binlog_size                         = 100M
    max_connect_errors                      = 100000000
    pid-file                                = /var/run/mysqld/mysqld.pid
    port                                    = 3306
    relay_log                               = second-server-relay-bin
    relay_log_info_repository               = TABLE
    report_host                             = BB.BBB.BB.B
    server_id                               = 2
    skip_external_locking
    slow_query_log                          = 1
    slow_query_log_file                     = /var/log/mysql/slow_query.log
    socket                                  = /var/run/mysqld/mysqld.sock
    thread_cache_size                       = 8
    thread_stack                            = 192K
    tmpdir                                  = /tmp
    transaction_write_set_extraction        = XXHASH64
    user                                    = mysql
    
    [mysqldump]
    max_allowed_packet                      = 16M
    quick
    quote_names
    
    [mysql]
    no_auto_rehash
    
    [isamchk]
    key_buffer_size                         = 16M
    
    [client]
    port                                    = 3306
    socket                                  = /var/run/mysqld/mysqld.sock
    
    !includedir /etc/mysql/conf.d/
    

    两台服务器都启动了,错误日志中没有错误。

    3)现在我尝试引导组:

    在第一台服务器上:
      mysql> SET GLOBAL GROUP_REPLICATION_BOOTSTRAP_GROUP=ON;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> START GROUP_REPLICATION;
    Query OK, 0 rows affected (2.11 sec)
    
    mysql> SET GLOBAL GROUP_REPLICATION_BOOTSTRAP_GROUP=OFF;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SELECT * FROM performance_schema.replication_group_members;
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | group_replication_applier | 111-111-111-111-111111-111111-111111 | AA.AAA.AA.A |        3306 | ONLINE       |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    1 row in set (0.00 sec)
    

    这看起来不错,日志文件中没有错误。

    在第二台服务器上:
    mysql> START GROUP_REPLICATION;
    ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log.
    mysql> SELECT * FROM performance_schema.replication_group_members;
    +---------------------------+--------------------------------------+-----------------+-------------+--------------+
    | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST     | MEMBER_PORT | MEMBER_STATE |
    +---------------------------+--------------------------------------+-----------------+-------------+--------------+
    | group_replication_applier | 222-222-222-222-222222-222222-222222 | BBB.BBB.BBB.BBB |        3306 | OFFLINE      |
    +---------------------------+--------------------------------------+-----------------+-------------+--------------+
    1 row in set (0.00 sec)
    

    在日志文件中,我可以看到组复制成功启动,第二台服务器连接到自己(BBB.0.0.000:33061)和第一台服务器(AA.AAA.AA.A:33061)--“连接成功使用 SSL”——但在我收到以下两个错误后立即出现:[GCS] 等待组通信引擎准备就绪时超时!和 [GCS] 群组通讯引擎尚未准备好让成员加入。本地端口:33061
    2018-04-15T00:15:05.987696Z 5 [Note] '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=''.
    2018-04-15T00:15:05.990639Z 3 [Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!'
    2018-04-15T00:15:05.990714Z 3 [Note] Plugin group_replication reported: 'auto_increment_increment is set to 7'
    2018-04-15T00:15:05.990754Z 3 [Note] Plugin group_replication reported: 'auto_increment_offset is set to 1'
    2018-04-15T00:15:05.990866Z 8 [Note] Slave SQL thread for channel 'group_replication_applier' initialized, starting replication in log 'FIRST' at position 0, relay log './second-server-relay-bin-group_replication_applier.000012' position: 4
    2018-04-15T00:15:05.991232Z 0 [Note] Plugin group_replication reported: 'state 0 action xa_init'
    2018-04-15T00:15:06.013709Z 0 [Note] Plugin group_replication reported: 'Successfully bound to 0.0.0.0:33061 (socket=51).'
    2018-04-15T00:15:06.013787Z 0 [Note] Plugin group_replication reported: 'Successfully set listen backlog to 32 (socket=51)!'
    2018-04-15T00:15:06.013827Z 0 [Note] Plugin group_replication reported: 'Successfully unblocked socket (socket=51)!'
    2018-04-15T00:15:06.013876Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.013989Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 52'
    2018-04-15T00:15:06.014094Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.014188Z 0 [Note] Plugin group_replication reported: 'Ready to accept incoming connections on 0.0.0.0:33061 (socket=51)!'
    2018-04-15T00:15:06.027381Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.027583Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.027665Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 62'
    2018-04-15T00:15:06.027730Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.040561Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.040752Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.040831Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 66'
    2018-04-15T00:15:06.040894Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.053675Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.053889Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.053975Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 70'
    2018-04-15T00:15:06.054045Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.067043Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.067228Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.067305Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 74'
    2018-04-15T00:15:06.067368Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.080143Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.080326Z 0 [Note] Plugin group_replication reported: 'connecting to BBB.0.0.000 33061'
    2018-04-15T00:15:06.080403Z 0 [Note] Plugin group_replication reported: 'client connected to BBB.0.0.000 33061 fd 78'
    2018-04-15T00:15:06.080465Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.093262Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:06.093460Z 0 [Note] Plugin group_replication reported: 'connecting to AA.AAA.AA.A 33061'
    2018-04-15T00:15:06.125679Z 0 [Note] Plugin group_replication reported: 'client connected to AA.AAA.AA.A 33061 fd 82'
    2018-04-15T00:15:06.125774Z 0 [Note] Plugin group_replication reported: 'Trying to connect using SSL.'
    2018-04-15T00:15:06.204717Z 0 [Note] Plugin group_replication reported: 'Success connecting using SSL.'
    2018-04-15T00:15:36.270721Z 0 [ERROR] Plugin group_replication reported: '[GCS] Timeout while waiting for the group communication engine to be ready!'
    2018-04-15T00:15:36.270933Z 0 [ERROR] Plugin group_replication reported: '[GCS] The group communication engine is not ready for the member to join. Local port: 33061'
    2018-04-15T00:15:36.271093Z 0 [Note] Plugin group_replication reported: 'state 4337 action xa_terminate'
    2018-04-15T00:15:36.271158Z 0 [Note] Plugin group_replication reported: 'new state x_start'
    2018-04-15T00:15:36.271210Z 0 [Note] Plugin group_replication reported: 'state 4337 action xa_exit'
    2018-04-15T00:15:36.271331Z 0 [Note] Plugin group_replication reported: 'Exiting xcom thread'
    2018-04-15T00:15:36.271383Z 0 [Note] Plugin group_replication reported: 'new state x_start'
    2018-04-15T00:15:36.273406Z 0 [Warning] Plugin group_replication reported: 'read failed'
    2018-04-15T00:15:36.281153Z 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
    2018-04-15T00:16:05.990871Z 3 [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group'
    2018-04-15T00:16:05.991036Z 3 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'
    2018-04-15T00:16:05.991118Z 3 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'
    2018-04-15T00:16:05.991182Z 0 [Note] Plugin group_replication reported: 'Destroying SSL'
    2018-04-15T00:16:05.991242Z 0 [Note] Plugin group_replication reported: 'Success destroying SSL'
    2018-04-15T00:16:05.991352Z 3 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'
    2018-04-15T00:16:05.991408Z 3 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'
    2018-04-15T00:16:05.991618Z 8 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed
    2018-04-15T00:16:05.992230Z 5 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'
    

    当我回到第一个服务器时,日志中没有任何移动,它们与以前完全相同。

    我找不到关于这两个错误的任何有用信息: “等待组通信引擎准备就绪时超时!”和“群组通信引擎尚未准备好让成员加入。本地端口:33061”

    有没有人以前见过这个并知道它表示什么?

    最佳答案

    事实证明,这是一个网络问题。我只需要使用公共(public) IP,而不是混合使用内部 IP 和公共(public) IP。此外,我需要运行一个 ifconfig 命令来绑定(bind)服务器的公共(public) IP。

    在每台服务器上,我运行“ifconfig”来标识网络端点的名称。然后我运行“ifcongig ntwk 00.00.00.00”:

     @FirstServer> ifconfig
     en1       Link encap:Ethernet  HWaddr 00:00:00:00:00:00
               inet addr:00.00.00.00  Bcast:00.00.00.255  Mask:255.255.255.0
               inet6 addr: 00::00:00:00:00/64 Scope:Link
               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
               RX packets:718094 errors:0 dropped:104 overruns:0 frame:0
               TX packets:708888 errors:0 dropped:0 overruns:0 carrier:0
               collisions:0 txqueuelen:1000
               RX bytes:666094518 (666.0 MB)  TX bytes:493309981 (493.3 MB)
    
     lo        Link encap:Local Loopback
               inet addr:127.0.0.1  Mask:255.0.0.0
               inet6 addr: ::1/128 Scope:Host
               UP LOOPBACK RUNNING  MTU:65536  Metric:1
               RX packets:46526 errors:0 dropped:0 overruns:0 frame:0
               TX packets:46526 errors:0 dropped:0 overruns:0 carrier:0
               collisions:0 txqueuelen:1
               RX bytes:13353180 (13.3 MB)  TX bytes:13353180 (13.3 MB)
    
    
    @FirstServer> sudo ifconfig en1:1 AA.AAA.AA.A
    

    第二台服务器:
     @SecondServer> ifconfig
     MyNets    Link encap:Ethernet  HWaddr 00:00:00:00:00:00
               inet addr:00.00.00.00  Bcast:00.00.00.255  Mask:255.255.255.0
               inet6 addr: 00::00:00:00:00/64 Scope:Link
               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
               RX packets:718094 errors:0 dropped:104 overruns:0 frame:0
               TX packets:708888 errors:0 dropped:0 overruns:0 carrier:0
               collisions:0 txqueuelen:1000
               RX bytes:666094518 (666.0 MB)  TX bytes:493309981 (493.3 MB)
    
     lo        Link encap:Local Loopback
               inet addr:127.0.0.1  Mask:255.0.0.0
               inet6 addr: ::1/128 Scope:Host
               UP LOOPBACK RUNNING  MTU:65536  Metric:1
               RX packets:46526 errors:0 dropped:0 overruns:0 frame:0
               TX packets:46526 errors:0 dropped:0 overruns:0 carrier:0
               collisions:0 txqueuelen:1
               RX bytes:13353180 (13.3 MB)  TX bytes:13353180 (13.3 MB)
    
    
    @SecondServer> sudo ifconfig MyNets:1 BBB.BBB.BBB.BBB
    

    绑定(bind)到公共(public) IP 地址后,我更新了配置文件。第一个服务器配置文件是:
    [mysqld_safe]
    nice                                    = 0
    socket                                  = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    basedir                                 = /usr
    bind_address                            = 0.0.0.0
    binlog_checksum                         = NONE
    binlog_format                           = ROW
    datadir                                 = /var/lib/mysql
    enforce_gtid_consistency                = ON
    general_log                             = 1
    general_log_file                        = /var/log/mysql/mysql.log
    gtid_mode                               = ON
    key_buffer_size                         = 8388608
    lc_messages_dir                         = /usr/share/mysql
    log_bin                                 = binlog
    log_error                               = /var/log/mysql/error.log
    log_slave_updates                       = ON
    long_query_time                         = 60
    loose-group_replication_allow_local_disjoint_gtids_join= ON
    loose-group_replication_bootstrap_group = OFF
    loose-group_replication_enforce_update_everywhere_checks= ON
    loose-group_replication_group_name      = ZZZZZZ-ZZZZZZ-ZZZZZZ-ZZZZZZ
    loose-group_replication_group_seeds     = AA.AAA.AA.A:33061,BBB.BBB.BBB.BBB:33061
    loose-group_replication_ip_whitelist    = AA.AAA.AA.A,BBB.BBB.BBB.BBB
    loose-group_replication_local_address   = AA.AAA.AA.A:33061
    loose-group_replication_recovery_use_ssl= 1
    loose-group_replication_single_primary_mode= OFF
    loose-group_replication_ssl_mode        = REQUIRED
    loose-group_replication_start_on_boot   = OFF
    master_info_repository                  = TABLE
    max_allowed_packet                      = 16M
    max_binlog_size                         = 100M
    max_connect_errors                      = 100000000
    pid-file                                = /var/run/mysqld/mysqld.pid
    port                                    = 3306
    relay_log                               = first-server-relay-bin
    relay_log_info_repository               = TABLE
    report_host                             = AA.AAA.AA.A
    server_id                               = 1
    skip_external_locking
    slow_query_log                          = 1
    slow_query_log_file                     = /var/log/mysql/slow_query.log
    socket                                  = /var/run/mysqld/mysqld.sock
    thread_cache_size                       = 8
    thread_stack                            = 192K
    tmpdir                                  = /tmp
    transaction_write_set_extraction        = XXHASH64
    user                                    = mysql
    
    [mysqldump]
    max_allowed_packet                      = 16M
    quick
    quote_names
    
    [mysql]
    no_auto_rehash
    
    [isamchk]
    key_buffer_size                         = 16M
    
    [client]
    port                                    = 3306
    socket                                  = /var/run/mysqld/mysqld.sock
    
    !includedir /etc/mysql/conf.d/
    

    第二个服务器配置文件是:
    [mysqld_safe]
    nice                                    = 0
    socket                                  = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    basedir                                 = /usr
    bind_address                            = 0.0.0.0
    binlog_checksum                         = NONE
    binlog_format                           = ROW
    datadir                                 = /var/lib/mysql
    enforce_gtid_consistency                = ON
    general_log                             = 1
    general_log_file                        = /var/log/mysql/mysql.log
    gtid_mode                               = ON
    key_buffer_size                         = 8388608
    lc_messages_dir                         = /usr/share/mysql
    log_bin                                 = binlog
    log_error                               = /var/log/mysql/error.log
    log_slave_updates                       = ON
    long_query_time                         = 60
    loose-group_replication_allow_local_disjoint_gtids_join= ON
    loose-group_replication_bootstrap_group = OFF
    loose-group_replication_enforce_update_everywhere_checks= ON
    loose-group_replication_group_name      = ZZZZZZ-ZZZZZZ-ZZZZZZ-ZZZZZZ
    loose-group_replication_group_seeds     = BB.BBB.BB.B:33061,AA.AAA.AA.A:33061
    loose-group_replication_ip_whitelist    = BB.BBB.BB.B,AA.AAA.AA.A
    loose-group_replication_local_address   = BB.BBB.BB.B:33061
    loose-group_replication_recovery_use_ssl= 1
    loose-group_replication_single_primary_mode= OFF
    loose-group_replication_ssl_mode        = REQUIRED
    loose-group_replication_start_on_boot   = OFF
    master_info_repository                  = TABLE
    max_allowed_packet                      = 16M
    max_binlog_size                         = 100M
    max_connect_errors                      = 100000000
    pid-file                                = /var/run/mysqld/mysqld.pid
    port                                    = 3306
    relay_log                               = second-server-relay-bin
    relay_log_info_repository               = TABLE
    report_host                             = BB.BBB.BB.B
    server_id                               = 2
    skip_external_locking
    slow_query_log                          = 1
    slow_query_log_file                     = /var/log/mysql/slow_query.log
    socket                                  = /var/run/mysqld/mysqld.sock
    thread_cache_size                       = 8
    thread_stack                            = 192K
    tmpdir                                  = /tmp
    transaction_write_set_extraction        = XXHASH64
    user                                    = mysql
    
    [mysqldump]
    max_allowed_packet                      = 16M
    quick
    quote_names
    
    [mysql]
    no_auto_rehash
    
    [isamchk]
    key_buffer_size                         = 16M
    
    [client]
    port                                    = 3306
    socket                                  = /var/run/mysqld/mysqld.sock
    
    !includedir /etc/mysql/conf.d/
    

    最后,在第一台服务器上,我重新启动了 mysql,登录并运行了以下命令:
    mysql> SET GLOBAL GROUP_REPLICATION_BOOTSTRAP_GROUP=ON;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> START GROUP_REPLICATION;
    Query OK, 0 rows affected (2.11 sec)
    
    mysql> SET GLOBAL GROUP_REPLICATION_BOOTSTRAP_GROUP=OFF;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SELECT * FROM performance_schema.replication_group_members;
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | group_replication_applier | 111-111-111-111-111111-111111-111111 | AA.AAA.AA.A |        3306 | ONLINE       |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    1 row in set (0.00 sec)
    

    在第二台服务器上,我重新启动了 mysql,登录并运行了以下命令:
    mysql> START GROUP_REPLICATION;
    Query OK, 0 rows affected (2.11 sec)
    
    mysql> SELECT * FROM performance_schema.replication_group_members;
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | group_replication_applier | 111-111-111-111-111111-111111-111111 | AA.AAA.AA.A |        3306 | ONLINE       |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    | group_replication_applier | 111-111-111-111-111111-111111-111111 | BBB.BBB.BBB.BBB |    3306 | ONLINE       |
    +---------------------------+--------------------------------------+-------------+-------------+--------------+
    1 row in set (0.00 sec)
    

    现在他们正在沟通和联系!

    关于MySQL 组复制 : Timeout while waiting for the group communication engine to be ready,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49837554/

    10-11 07:03