GreatSQL社区

搜索

[已解决] MGR集群配置问题

38 3 3 天前
本帖最后由 lvhejin 于 2026-1-16 18:51 编辑

我是 利用手动方式构建MGR ,参考文档:https://greatsql.cn/docs/8.4.4-4/8-mgr/2-mgr-install-deploy.html  


192.168.0.7  该节点执行:START group_replication;    启动成功



192.168.0.11
192.168.0.12

这两个节点执行:START group_replication;     均异常:

(Fri Jan 16 14:35:24 2026)[root@GreatSQL][(none)]>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.


error.log
  1. [root@GreatSQL-02 GreatSQL]# vi error.log
  2. 2026-01-16T11:19:23.152082+08:00 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
  3. 2026-01-16T11:19:23.153806+08:00 0 [Warning] [MY-011070] [Server] 'binlog_format' is deprecated and will be removed in a future release.
  4. 2026-01-16T11:19:23.153841+08:00 0 [Warning] [MY-011069] [Server] The syntax '--replica-parallel-type' is deprecated and will be removed in a future release.
  5. 2026-01-16T11:19:23.154006+08:00 0 [Note] [MY-010096] [Server] Ignoring --secure-file-priv value as server is running with --initialize(-insecure).
  6. 2026-01-16T11:19:23.154011+08:00 0 [Note] [MY-010096] [Server] Ignoring --secure-log-path value as server is running with --initialize(-insecure).
  7. 2026-01-16T11:19:23.154042+08:00 0 [Note] [MY-013932] [Server] BuildID[sha1]=ba303d5357affecb6d9d28c2a9f1e4d8c2cb10ee
  8. 2026-01-16T11:19:23.154046+08:00 0 [Note] [MY-010949] [Server] Basedir set to /usr/local/GreatSQL-8.4.4-4-Linux-glibc2.28-aarch64/.
  9. 2026-01-16T11:19:23.154057+08:00 0 [System] [MY-013169] [Server] /usr/local/GreatSQL-8.4.4-4-Linux-glibc2.28-aarch64/bin/mysqld (mysqld 8.4.4-4) initializing of server in progress as process 178936
  10. 2026-01-16T11:19:23.159263+08:00 0 [Note] [MY-010458] [Server] --initialize specified on an existing data directory.
  11. 2026-01-16T11:19:23.164979+08:00 0 [Note] [MY-010938] [Server] Generating a new UUID: 27901a21-f28a-11f0-8ce4-fa163e2768ec.
  12. 2026-01-16T11:19:23.169261+08:00 0 [Note] [MY-012366] [InnoDB] Using Linux native AIO
  13. 2026-01-16T11:19:23.169547+08:00 0 [Note] [MY-010747] [Server] Plugin 'FEDERATED' is disabled.
  14. 2026-01-16T11:19:23.169622+08:00 0 [Note] [MY-010747] [Server] Plugin 'ndbcluster' is disabled.
  15. 2026-01-16T11:19:23.169645+08:00 0 [Note] [MY-010747] [Server] Plugin 'ndbinfo' is disabled.
  16. 2026-01-16T11:19:23.169660+08:00 0 [Note] [MY-010747] [Server] Plugin 'ndb_transid_mysql_connection_map' is disabled.
  17. 2026-01-16T11:19:23.169758+08:00 0 [Note] [MY-010747] [Server] Plugin 'mysql_native_password' is disabled.
  18. 2026-01-16T11:19:23.171045+08:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
  19. 2026-01-16T11:19:23.171108+08:00 1 [Note] [MY-013546] [InnoDB] Atomic write enabled
  20. 2026-01-16T11:19:23.171132+08:00 1 [Note] [MY-012274] [InnoDB] The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
  21. 2026-01-16T11:19:23.171149+08:00 1 [Note] [MY-012932] [InnoDB] PUNCH HOLE support available
  22. 2026-01-16T11:19:23.171166+08:00 1 [Note] [MY-012944] [InnoDB] Uses event mutexes
  23. 2026-01-16T11:19:23.171175+08:00 1 [Note] [MY-012945] [InnoDB] GCC builtin __atomic_thread_fence() is used for memory barrier
  24. 2026-01-16T11:19:23.171184+08:00 1 [Note] [MY-012948] [InnoDB] Compressed tables use zlib 1.3.1
  25. 2026-01-16T11:19:23.174668+08:00 1 [Note] [MY-011066] [InnoDB] File purge : set file purge path : /data/GreatSQL/#file_purge
  26. 2026-01-16T11:19:23.174751+08:00 1 [Note] [MY-012951] [InnoDB] Using hardware accelerated crc32 and polynomial multiplication.
  27. 2026-01-16T11:19:23.175030+08:00 1 [Note] [MY-012203] [InnoDB] Directories to scan './'
  28. 2026-01-16T11:19:23.175079+08:00 1 [Note] [MY-012204] [InnoDB] Scanning './'
  29. 2026-01-16T11:19:23.175136+08:00 1 [Note] [MY-012208] [InnoDB] Completed space ID check of 0 files.
  30. 2026-01-16T11:19:23.176752+08:00 1 [Note] [MY-012955] [InnoDB] Initializing buffer pool, total size = 5.000000G, instances = 8, chunk size =128.000000M
  31. 2026-01-16T11:19:23.352726+08:00 1 [Note] [MY-012957] [InnoDB] Completed initialization of buffer pool
  32. 2026-01-16T11:19:23.366382+08:00 1 [Note] [MY-012265] [InnoDB] Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
  33. 2026-01-16T11:19:23.422262+08:00 1 [Note] [MY-012266] [InnoDB] File './ibdata1' size is now 12 MB.
  34. 2026-01-16T11:19:23.422393+08:00 1 [Note] [MY-013566] [InnoDB] Double write buffer files: 2
  35. 2026-01-16T11:19:23.422421+08:00 1 [Note] [MY-013565] [InnoDB] Double write buffer pages per instance: 128
  36. 2026-01-16T11:19:23.424481+08:00 1 [Note] [MY-013532] [InnoDB] Using './#ib_16384_0.dblwr' for doublewrite
  37. 2026-01-16T11:19:23.507405+08:00 1 [Note] [MY-013532] [InnoDB] Using './#ib_16384_1.dblwr' for doublewrite
  38. 2026-01-16T11:19:23.714537+08:00 1 [Note] [MY-012893] [InnoDB] New redo log files created, LSN=8204
  39. 2026-01-16T11:19:23.714673+08:00 1 [Note] [MY-013083] [InnoDB] Log background threads are being started...
  40. 2026-01-16T11:19:23.744379+08:00 1 [Note] [MY-012896] [InnoDB] Creating UNDO Tablespace ./undo_001
  41. 2026-01-16T11:19:23.746582+08:00 1 [Note] [MY-012897] [InnoDB] Setting file ./undo_001 size to 16 MB
  42. 2026-01-16T11:19:23.746602+08:00 1 [Note] [MY-012898] [InnoDB] Physically writing the file full
  43. 2026-01-16T11:19:23.834249+08:00 1 [Note] [MY-012896] [InnoDB] Creating UNDO Tablespace ./undo_002
  44. 2026-01-16T11:19:23.834294+08:00 1 [Note] [MY-012897] [InnoDB] Setting file ./undo_002 size to 16 MB
  45. 2026-01-16T11:19:23.834307+08:00 1 [Note] [MY-012898] [InnoDB] Physically writing the file full
  46. "error.log" 629L, 93104B
复制代码





my.cnf配置文件内容:
192.168.0.7:
  1. [client]
  2. socket = /data/GreatSQL/mysql.sock

  3. [mysql]
  4. loose-skip-binary-as-hex
  5. prompt = "(\\D)[\\u@GreatSQL][\\d]>"
  6. no-auto-rehash

  7. [mysqld]
  8. # 基础配置(复用可运行配置,确保路径一致)
  9. user = mysql
  10. port = 3306
  11. server_id = 7  # 节点唯一ID
  12. log_replica_updates = 1  # 替代废弃的log_slave_updates,8.4兼容
  13. basedir = /usr/local/GreatSQL-8.4.4-4-Linux-glibc2.28-aarch64
  14. datadir = /data/GreatSQL
  15. socket = /data/GreatSQL/mysql.sock
  16. pid-file = mysql.pid
  17. character-set-server = UTF8MB4
  18. skip_name_resolve = ON
  19. default_time_zone = "+8:00"
  20. bind_address = "0.0.0.0"
  21. secure_file_priv = /data/GreatSQL

  22. # 性能配置(复用可运行配置,无需修改)
  23. lock_wait_timeout = 3600
  24. open_files_limit = 65535
  25. back_log = 1024
  26. max_connections = 1024
  27. max_connect_errors = 1000000
  28. table_open_cache = 4096
  29. table_definition_cache = 2048
  30. thread_stack = 512K
  31. sort_buffer_size = 4M
  32. join_buffer_size = 4M
  33. read_buffer_size = 8M
  34. read_rnd_buffer_size = 4M
  35. bulk_insert_buffer_size = 64M
  36. thread_cache_size = 768
  37. interactive_timeout = 600
  38. wait_timeout = 600
  39. tmp_table_size = 96M
  40. max_heap_table_size = 96M
  41. max_allowed_packet = 64M
  42. net_buffer_shrink_interval = 180
  43. sql_generate_invisible_primary_key = ON
  44. loose-lock_ddl_polling_mode = ON
  45. loose-lock_ddl_polling_runtime = 200

  46. # 日志配置(复用可运行配置,确保日志文件路径正确)
  47. log_timestamps = SYSTEM
  48. log_error = error.log
  49. log_error_verbosity = 3
  50. slow_query_log = ON
  51. log_slow_extra = ON
  52. slow_query_log_file = slow.log
  53. long_query_time = 0.01
  54. log_queries_not_using_indexes = ON
  55. log_throttle_queries_not_using_indexes = 60
  56. min_examined_row_limit = 100
  57. log_slow_admin_statements = ON
  58. log_slow_replica_statements = ON
  59. log_slow_verbosity = FULL
  60. log_bin = binlog
  61. binlog_format = ROW
  62. sync_binlog = 1
  63. binlog_cache_size = 4M
  64. max_binlog_cache_size = 6G
  65. max_binlog_size = 1G
  66. binlog_space_limit = 500G
  67. binlog_rows_query_log_events = ON
  68. binlog_expire_logs_seconds = 604800  # 7天,8.4兼容
  69. binlog_checksum = CRC32
  70. binlog_order_commits = OFF
  71. gtid_mode = ON
  72. enforce_gtid_consistency = ON

  73. # 复制配置(复用可运行配置,移除废弃参数)
  74. relay-log = relaylog
  75. relay_log_recovery = ON
  76. replica_parallel_type = LOGICAL_CLOCK
  77. replica_parallel_workers = 16
  78. replica_preserve_commit_order = ON
  79. replica_checkpoint_period = 2
  80. loose-rpl_read_binlog_speed_limit = 100

  81. # MGR 核心配置(复用可运行配置,仅修改节点专属参数)
  82. loose-plugin_load_add = 'mysql_clone.so'
  83. loose-plugin_load_add = 'group_replication.so'
  84. loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"  # 集群唯一标识,3节点一致
  85. loose-group_replication_view_change_uuid = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb1"  # 3节点一致
  86. loose-group_replication_local_address = "192.168.0.7:33061"  # 节点本地通信地址
  87. loose-group_replication_group_seeds = '192.168.0.7:33061,192.168.0.11:33061,192.168.0.12:33061'  # 所有节点通信地址
  88. report_host = "192.168.0.7"  # 节点对外报告IP,与本机IP一致
  89. loose-group_replication_communication_stack = "XCOM"
  90. loose-group_replication_recovery_use_ssl = OFF
  91. loose-group_replication_ssl_mode = DISABLED
  92. loose-group_replication_start_on_boot = OFF
  93. loose-group_replication_bootstrap_group = OFF
  94. loose-group_replication_exit_state_action = READ_ONLY
  95. loose-group_replication_flow_control_mode = "DISABLED"
  96. loose-group_replication_single_primary_mode = ON
  97. loose-group_replication_enforce_update_everywhere_checks = OFF
  98. loose-group_replication_majority_after_mode = ON
  99. loose-group_replication_communication_max_message_size = 10M
  100. loose-group_replication_arbitrator = OFF
  101. loose-group_replication_single_primary_fast_mode = 1
  102. loose-group_replication_request_time_threshold = 100
  103. loose-group_replication_primary_election_mode = GTID_FIRST
  104. loose-group_replication_unreachable_majority_timeout = 0
  105. loose-group_replication_member_expel_timeout = 5
  106. loose-group_replication_autorejoin_tries = 288
  107. loose-group_replication_recovery_get_public_key = ON
  108. loose-group_replication_donor_threshold = 100

  109. # InnoDB 配置(复用可运行配置,确保性能适配)
  110. innodb_buffer_pool_size = 5G  # 按实际内存调整(专用服务器建议50%-70%)
  111. innodb_buffer_pool_instances = 8
  112. innodb_data_file_path = ibdata1:12M:autoextend
  113. innodb_flush_log_at_trx_commit = 1
  114. innodb_log_buffer_size = 64M
  115. innodb_redo_log_capacity = 6G
  116. innodb_doublewrite_files = 2
  117. innodb_doublewrite_pages = 128
  118. innodb_max_undo_log_size = 4G
  119. innodb_io_capacity = 10000
  120. innodb_io_capacity_max = 20000
  121. innodb_open_files = 65535
  122. innodb_flush_method = O_DIRECT
  123. innodb_use_fdatasync = ON
  124. innodb_lru_scan_depth = 4000
  125. innodb_lock_wait_timeout = 10
  126. innodb_rollback_on_timeout = ON
  127. innodb_print_all_deadlocks = ON
  128. innodb_online_alter_log_max_size = 4G
  129. innodb_print_ddl_logs = ON
  130. innodb_status_file = ON
  131. innodb_status_output = OFF
  132. innodb_status_output_locks = ON
  133. innodb_sort_buffer_size = 64M
  134. innodb_adaptive_hash_index = OFF
  135. innodb_numa_interleave = OFF
  136. innodb_spin_wait_delay = 20
  137. innodb_print_lock_wait_timeout_info = ON
  138. innodb_change_buffering = none
  139. kill_idle_transaction = 300
  140. innodb_data_file_async_purge = ON

  141. # 性能_schema配置(复用可运行配置)
  142. performance_schema = 1
  143. performance_schema_instrument = '%lock%=on'
复制代码


192.168.0.11:
  1. [client]
  2. socket = /data/GreatSQL/mysql.sock

  3. [mysql]
  4. loose-skip-binary-as-hex
  5. prompt = "(\\D)[\\u@GreatSQL][\\d]>"
  6. no-auto-rehash

  7. [mysqld]
  8. # 基础配置(复用可运行配置,确保路径一致)
  9. user = mysql
  10. port = 3306
  11. server_id = 11  # 节点唯一ID
  12. log_replica_updates = 1  # 替代废弃的log_slave_updates,8.4兼容
  13. basedir = /usr/local/GreatSQL-8.4.4-4-Linux-glibc2.28-aarch64
  14. datadir = /data/GreatSQL
  15. socket = /data/GreatSQL/mysql.sock
  16. pid-file = mysql.pid
  17. character-set-server = UTF8MB4
  18. skip_name_resolve = ON
  19. default_time_zone = "+8:00"
  20. bind_address = "0.0.0.0"
  21. secure_file_priv = /data/GreatSQL

  22. # 性能配置(复用可运行配置,无需修改)
  23. lock_wait_timeout = 3600
  24. open_files_limit = 65535
  25. back_log = 1024
  26. max_connections = 1024
  27. max_connect_errors = 1000000
  28. table_open_cache = 4096
  29. table_definition_cache = 2048
  30. thread_stack = 512K
  31. sort_buffer_size = 4M
  32. join_buffer_size = 4M
  33. read_buffer_size = 8M
  34. read_rnd_buffer_size = 4M
  35. bulk_insert_buffer_size = 64M
  36. thread_cache_size = 768
  37. interactive_timeout = 600
  38. wait_timeout = 600
  39. tmp_table_size = 96M
  40. max_heap_table_size = 96M
  41. max_allowed_packet = 64M
  42. net_buffer_shrink_interval = 180
  43. sql_generate_invisible_primary_key = ON
  44. loose-lock_ddl_polling_mode = ON
  45. loose-lock_ddl_polling_runtime = 200

  46. # 日志配置(复用可运行配置,确保日志文件路径正确)
  47. log_timestamps = SYSTEM
  48. log_error = error.log
  49. log_error_verbosity = 3
  50. slow_query_log = ON
  51. log_slow_extra = ON
  52. slow_query_log_file = slow.log
  53. long_query_time = 0.01
  54. log_queries_not_using_indexes = ON
  55. log_throttle_queries_not_using_indexes = 60
  56. min_examined_row_limit = 100
  57. log_slow_admin_statements = ON
  58. log_slow_replica_statements = ON
  59. log_slow_verbosity = FULL
  60. log_bin = binlog
  61. binlog_format = ROW
  62. sync_binlog = 1
  63. binlog_cache_size = 4M
  64. max_binlog_cache_size = 6G
  65. max_binlog_size = 1G
  66. binlog_space_limit = 500G
  67. binlog_rows_query_log_events = ON
  68. binlog_expire_logs_seconds = 604800  # 7天,8.4兼容
  69. binlog_checksum = CRC32
  70. binlog_order_commits = OFF
  71. gtid_mode = ON
  72. enforce_gtid_consistency = ON

  73. # 复制配置(复用可运行配置,移除废弃参数)
  74. relay-log = relaylog
  75. relay_log_recovery = ON
  76. replica_parallel_type = LOGICAL_CLOCK
  77. replica_parallel_workers = 16
  78. replica_preserve_commit_order = ON
  79. replica_checkpoint_period = 2
  80. loose-rpl_read_binlog_speed_limit = 100

  81. # MGR 核心配置(复用可运行配置,仅修改节点专属参数)
  82. loose-plugin_load_add = 'mysql_clone.so'
  83. loose-plugin_load_add = 'group_replication.so'
  84. loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"  # 集群唯一标识,3节点一致
  85. loose-group_replication_view_change_uuid = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb1"  # 3节点一致
  86. loose-group_replication_local_address = "192.168.0.11:33061"  # 节点本地通信地址
  87. loose-group_replication_group_seeds = '192.168.0.7:33061,192.168.0.11:33061,192.168.0.12:33061'  # 所有节点通信地址
  88. report_host = "192.168.0.11"  # 节点对外报告IP,与本机IP一致
  89. loose-group_replication_communication_stack = "XCOM"
  90. loose-group_replication_recovery_use_ssl = OFF
  91. loose-group_replication_ssl_mode = DISABLED
  92. loose-group_replication_start_on_boot = OFF
  93. loose-group_replication_bootstrap_group = OFF
  94. loose-group_replication_exit_state_action = READ_ONLY
  95. loose-group_replication_flow_control_mode = "DISABLED"
  96. loose-group_replication_single_primary_mode = ON
  97. loose-group_replication_enforce_update_everywhere_checks = OFF
  98. loose-group_replication_majority_after_mode = ON
  99. loose-group_replication_communication_max_message_size = 10M
  100. loose-group_replication_arbitrator = OFF
  101. loose-group_replication_single_primary_fast_mode = 1
  102. loose-group_replication_request_time_threshold = 100
  103. loose-group_replication_primary_election_mode = GTID_FIRST
  104. loose-group_replication_unreachable_majority_timeout = 0
  105. loose-group_replication_member_expel_timeout = 5
  106. loose-group_replication_autorejoin_tries = 288
  107. loose-group_replication_recovery_get_public_key = ON
  108. loose-group_replication_donor_threshold = 100

  109. # InnoDB 配置(复用可运行配置,确保性能适配)
  110. innodb_buffer_pool_size = 5G  # 按实际内存调整(专用服务器建议50%-70%)
  111. innodb_buffer_pool_instances = 8
  112. innodb_data_file_path = ibdata1:12M:autoextend
  113. innodb_flush_log_at_trx_commit = 1
  114. innodb_log_buffer_size = 64M
  115. innodb_redo_log_capacity = 6G
  116. innodb_doublewrite_files = 2
  117. innodb_doublewrite_pages = 128
  118. innodb_max_undo_log_size = 4G
  119. innodb_io_capacity = 10000
  120. innodb_io_capacity_max = 20000
  121. innodb_open_files = 65535
  122. innodb_flush_method = O_DIRECT
  123. innodb_use_fdatasync = ON
  124. innodb_lru_scan_depth = 4000
  125. innodb_lock_wait_timeout = 10
  126. innodb_rollback_on_timeout = ON
  127. innodb_print_all_deadlocks = ON
  128. innodb_online_alter_log_max_size = 4G
  129. innodb_print_ddl_logs = ON
  130. innodb_status_file = ON
  131. innodb_status_output = OFF
  132. innodb_status_output_locks = ON
  133. innodb_sort_buffer_size = 64M
  134. innodb_adaptive_hash_index = OFF
  135. innodb_numa_interleave = OFF
  136. innodb_spin_wait_delay = 20
  137. innodb_print_lock_wait_timeout_info = ON
  138. innodb_change_buffering = none
  139. kill_idle_transaction = 300
  140. innodb_data_file_async_purge = ON

  141. # 性能_schema配置(复用可运行配置)
  142. performance_schema = 1
  143. performance_schema_instrument = '%lock%=on'
复制代码


192.168.0.12:
  1. [client]
  2. socket = /data/GreatSQL/mysql.sock

  3. [mysql]
  4. loose-skip-binary-as-hex
  5. prompt = "(\\D)[\\u@GreatSQL][\\d]>"
  6. no-auto-rehash

  7. [mysqld]
  8. # 基础配置(复用可运行配置,确保路径一致)
  9. user = mysql
  10. port = 3306
  11. server_id = 12  # 节点唯一ID
  12. log_replica_updates = 1  # 替代废弃的log_slave_updates,8.4兼容
  13. basedir = /usr/local/GreatSQL-8.4.4-4-Linux-glibc2.28-aarch64
  14. datadir = /data/GreatSQL
  15. socket = /data/GreatSQL/mysql.sock
  16. pid-file = mysql.pid
  17. character-set-server = UTF8MB4
  18. skip_name_resolve = ON
  19. default_time_zone = "+8:00"
  20. bind_address = "0.0.0.0"
  21. secure_file_priv = /data/GreatSQL

  22. # 性能配置(复用可运行配置,无需修改)
  23. lock_wait_timeout = 3600
  24. open_files_limit = 65535
  25. back_log = 1024
  26. max_connections = 1024
  27. max_connect_errors = 1000000
  28. table_open_cache = 4096
  29. table_definition_cache = 2048
  30. thread_stack = 512K
  31. sort_buffer_size = 4M
  32. join_buffer_size = 4M
  33. read_buffer_size = 8M
  34. read_rnd_buffer_size = 4M
  35. bulk_insert_buffer_size = 64M
  36. thread_cache_size = 768
  37. interactive_timeout = 600
  38. wait_timeout = 600
  39. tmp_table_size = 96M
  40. max_heap_table_size = 96M
  41. max_allowed_packet = 64M
  42. net_buffer_shrink_interval = 180
  43. sql_generate_invisible_primary_key = ON
  44. loose-lock_ddl_polling_mode = ON
  45. loose-lock_ddl_polling_runtime = 200

  46. # 日志配置(复用可运行配置,确保日志文件路径正确)
  47. log_timestamps = SYSTEM
  48. log_error = error.log
  49. log_error_verbosity = 3
  50. slow_query_log = ON
  51. log_slow_extra = ON
  52. slow_query_log_file = slow.log
  53. long_query_time = 0.01
  54. log_queries_not_using_indexes = ON
  55. log_throttle_queries_not_using_indexes = 60
  56. min_examined_row_limit = 100
  57. log_slow_admin_statements = ON
  58. log_slow_replica_statements = ON
  59. log_slow_verbosity = FULL
  60. log_bin = binlog
  61. binlog_format = ROW
  62. sync_binlog = 1
  63. binlog_cache_size = 4M
  64. max_binlog_cache_size = 6G
  65. max_binlog_size = 1G
  66. binlog_space_limit = 500G
  67. binlog_rows_query_log_events = ON
  68. binlog_expire_logs_seconds = 604800  # 7天,8.4兼容
  69. binlog_checksum = CRC32
  70. binlog_order_commits = OFF
  71. gtid_mode = ON
  72. enforce_gtid_consistency = ON

  73. # 复制配置(复用可运行配置,移除废弃参数)
  74. relay-log = relaylog
  75. relay_log_recovery = ON
  76. replica_parallel_type = LOGICAL_CLOCK
  77. replica_parallel_workers = 16
  78. replica_preserve_commit_order = ON
  79. replica_checkpoint_period = 2
  80. loose-rpl_read_binlog_speed_limit = 100

  81. # MGR 核心配置(复用可运行配置,仅修改节点专属参数)
  82. loose-plugin_load_add = 'mysql_clone.so'
  83. loose-plugin_load_add = 'group_replication.so'
  84. loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"  # 集群唯一标识,3节点一致
  85. loose-group_replication_view_change_uuid = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb1"  # 3节点一致
  86. loose-group_replication_local_address = "192.168.0.12:33061"  # 节点本地通信地址
  87. loose-group_replication_group_seeds = '192.168.0.7:33061,192.168.0.11:33061,192.168.0.12:33061'  # 所有节点通信地址
  88. report_host = "192.168.0.12"  # 节点对外报告IP,与本机IP一致
  89. loose-group_replication_communication_stack = "XCOM"
  90. loose-group_replication_recovery_use_ssl = OFF
  91. loose-group_replication_ssl_mode = DISABLED
  92. loose-group_replication_start_on_boot = OFF
  93. loose-group_replication_bootstrap_group = OFF
  94. loose-group_replication_exit_state_action = READ_ONLY
  95. loose-group_replication_flow_control_mode = "DISABLED"
  96. loose-group_replication_single_primary_mode = ON
  97. loose-group_replication_enforce_update_everywhere_checks = OFF
  98. loose-group_replication_majority_after_mode = ON
  99. loose-group_replication_communication_max_message_size = 10M
  100. loose-group_replication_arbitrator = OFF
  101. loose-group_replication_single_primary_fast_mode = 1
  102. loose-group_replication_request_time_threshold = 100
  103. loose-group_replication_primary_election_mode = GTID_FIRST
  104. loose-group_replication_unreachable_majority_timeout = 0
  105. loose-group_replication_member_expel_timeout = 5
  106. loose-group_replication_autorejoin_tries = 288
  107. loose-group_replication_recovery_get_public_key = ON
  108. loose-group_replication_donor_threshold = 100

  109. # InnoDB 配置(复用可运行配置,确保性能适配)
  110. innodb_buffer_pool_size = 5G  # 按实际内存调整(专用服务器建议50%-70%)
  111. innodb_buffer_pool_instances = 8
  112. innodb_data_file_path = ibdata1:12M:autoextend
  113. innodb_flush_log_at_trx_commit = 1
  114. innodb_log_buffer_size = 64M
  115. innodb_redo_log_capacity = 6G
  116. innodb_doublewrite_files = 2
  117. innodb_doublewrite_pages = 128
  118. innodb_max_undo_log_size = 4G
  119. innodb_io_capacity = 10000
  120. innodb_io_capacity_max = 20000
  121. innodb_open_files = 65535
  122. innodb_flush_method = O_DIRECT
  123. innodb_use_fdatasync = ON
  124. innodb_lru_scan_depth = 4000
  125. innodb_lock_wait_timeout = 10
  126. innodb_rollback_on_timeout = ON
  127. innodb_print_all_deadlocks = ON
  128. innodb_online_alter_log_max_size = 4G
  129. innodb_print_ddl_logs = ON
  130. innodb_status_file = ON
  131. innodb_status_output = OFF
  132. innodb_status_output_locks = ON
  133. innodb_sort_buffer_size = 64M
  134. innodb_adaptive_hash_index = OFF
  135. innodb_numa_interleave = OFF
  136. innodb_spin_wait_delay = 20
  137. innodb_print_lock_wait_timeout_info = ON
  138. innodb_change_buffering = none
  139. kill_idle_transaction = 300
  140. innodb_data_file_async_purge = ON

  141. # 性能_schema配置(复用可运行配置)
  142. performance_schema = 1
  143. performance_schema_instrument = '%lock%=on'
复制代码


全部回复(3)
yejr 3 天前
glibc版本不兼容,得改用docker之类的方式了
或者自己编译
或者用MySQL原生的Shell(不支持仲裁节点,其余一样)
lvhejin 昨天 17:02

# 将其设置为MGR的引导节点(只有第一个节点需要这么做)后即可直接启动MGR服务:

SET GLOBAL group_replication_bootstrap_group=ON;
-- 精准查询该参数的值(ON=1,OFF=0)
SHOW GLOBAL VARIABLES LIKE 'group_replication_bootstrap_group';
START group_replication;
SET GLOBAL group_replication_bootstrap_group=OFF;

在所有节点执行这4条命令,都正常

如果在第1个节点执行这4条命令,正常

然后再在其他两个节点执行 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.
lvhejin 昨天 18:49
lvhejin 发表于 2026-1-16 17:02
# 将其设置为MGR的引导节点(只有第一个节点需要这么做)后即可直接启动MGR服务:

SET GLOBAL group_repl ...

问题解决了,首先要感谢“GreatSQL/MGR交流4群”  KAiTO 老师

MGR构建,困扰了我3、4天,因为项目尽,然后要切换国产化数据库,还没来的及仔细阅读社区文档,上来就就看着文档开始部署,希望KAiTO老师理解。

群里聊了一轮,按KAiTO老师的指导又配置了一遍,还是不行,后来老师直接提出远程操控,分分钟解决问题,一共解决了两个问题:

1、自己在网上找的文章,加的参数 “#loose-group_replication_view_change_uuid = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb1"  # 3节点一致”
1.1、解决方案:老师让直接删除,以社区文档为准,让我多看看文档

2、加入的节点和主节点事务不一样,执行的时候没SET SESSION sql_log_bin=0;
      
2.1、解决方案:把SECONDARY   节点的事务清空了,就能加入了,reset binary logs and gtids;  reset replica;
lvhejin

4

主题

0

博客

18

贡献

新手上路

Rank: 1

积分
26

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2026-1-17 18:06 , Processed in 0.025478 second(s), 14 queries , Redis On.
快速回复 返回顶部 返回列表