我要评分
获取效率
正确性
完整性
易理解

Setting MGR Parameters

For example, ports 3306, 3307, and 3308 form an MGR group.

  1. Add the following parameter settings to the /etc/my.cnf-master-mgr file of group member 1 (port 3306):
    ssl=0
    table_open_cache=30000
    max_connect_errors=2000
    innodb_adaptive_hash_index=0
    disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"
    server_id=1
    gtid_mode=ON
    enforce_gtid_consistency=ON
    binlog_checksum=NONE
    log_bin=binlog
    log_slave_updates=ON
    binlog_format=ROW
    master_info_repository=TABLE
    relay_log_info_repository=TABLE
    transaction_write_set_extraction=XXHASH64
    plugin_load_add='group_replication.so'
    group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
    group_replication_start_on_boot=off
    group_replication_local_address= "127.0.0.1:33061"
    group_replication_group_seeds= "127.0.0.1:33061,127.0.0.1:33071,127.0.0.1:33081"
    Table 1 Parameter description

    Parameter

    Description

    server_id

    Each group member has its own server ID.

    group_replication_local_address

    IP address and port number of the local host. The value of this parameter is used only for interaction with the group communication engine and cannot be the same as the IP address and port number for connecting to the client. In versions later than MySQL 8.0.14, an IPv6 address can be used.

    group_replication_group_seeds

    Addresses and ports of all group members.

  2. Add the following parameter settings to the /etc/my.cnf-slave-mgr file of group member 2 (port 3307):
    ssl=0
    table_open_cache=30000
    max_connect_errors=2000
    innodb_adaptive_hash_index=0
    disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"
    server_id=2
    gtid_mode=ON
    enforce_gtid_consistency=ON
    binlog_checksum=NONE
    log_bin=binlog
    log_slave_updates=ON
    binlog_format=ROW
    master_info_repository=TABLE
    relay_log_info_repository=TABLE
    transaction_write_set_extraction=XXHASH64
    plugin_load_add='group_replication.so'
    group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
    group_replication_start_on_boot=off
    group_replication_local_address= "127.0.0.1:33071"
    group_replication_group_seeds= "127.0.0.1:33061,127.0.0.1:33071,127.0.0.1:33081"
    Table 2 Parameter description

    Parameter

    Description

    server_id

    Each group member has its own server ID.

    group_replication_local_address

    IP address and port number of the local host. The value of this parameter is used only for interaction with the group communication engine and cannot be the same as the IP address and port number for connecting to the client. In versions later than MySQL 8.0.14, an IPv6 address can be used.

    group_replication_group_seeds

    Addresses and ports of all group members.

  3. Add the following parameter settings to the /etc/my.cnf-slave-2-mgr file of group member 3 (port 3308):
    ssl=0
    table_open_cache=30000
    max_connect_errors=2000
    innodb_adaptive_hash_index=0
    disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"
    server_id=3
    gtid_mode=ON
    enforce_gtid_consistency=ON
    binlog_checksum=NONE
    log_bin=binlog
    log_slave_updates=ON
    binlog_format=ROW
    master_info_repository=TABLE
    relay_log_info_repository=TABLE
    transaction_write_set_extraction=XXHASH64
    plugin_load_add='group_replication.so'
    group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
    group_replication_start_on_boot=off
    group_replication_local_address= "127.0.0.1:33081"
    group_replication_group_seeds= "127.0.0.1:33061,127.0.0.1:33071,127.0.0.1:33081"
    Table 3 Parameter description

    Parameter

    Description

    server_id

    Each group member has its own server ID.

    group_replication_local_address

    IP address and port number of the local host. The value of this parameter is used only for interaction with the group communication engine and cannot be the same as the IP address and port number for connecting to the client. In versions later than 8.0.14, an IPv6 address can be used.

    group_replication_group_seeds

    Addresses and ports of all group members.

  4. Restart the database.