@@ -27,75 +27,82 @@ var log = logf.Log.WithName("cluster.syncer")
2727
2828// mysqlSysConfigs is the map of mysql system configs.
2929var mysqlSysConfigs = map [string ]string {
30- "default-time-zone" : "+08:00" ,
31- "slow_query_log_file" : "/var/log/mysql/mysql-slow.log" ,
32- "read_only" : "ON" ,
33- "binlog_format" : "row" ,
34- "plugin-load" : "\" semisync_master.so;semisync_slave.so;audit_log.so;connection_control.so\" " ,
35- "log-bin" : "/var/lib/mysql/mysql-bin" ,
36- "log-timestamps" : "SYSTEM" ,
37- "innodb_open_files" : "655360" ,
38- "open_files_limit" : "655360" ,
39- "rpl_semi_sync_master_enabled" : "OFF" ,
40- "rpl_semi_sync_slave_enabled" : "ON" ,
41- "rpl_semi_sync_master_wait_no_slave" : "ON" ,
42- "rpl_semi_sync_master_timeout" : "1000000000000000000" ,
43- "gtid-mode" : "ON" ,
44- "enforce-gtid-consistency" : "ON" ,
45- "slave_parallel_type" : "LOGICAL_CLOCK" ,
46- "relay_log" : "/var/lib/mysql/mysql-relay-bin" ,
47- "relay_log_index" : "/var/lib/mysql/mysql-relay-bin.index" ,
48- "master_info_repository" : "TABLE" ,
49- "relay_log_info_repository" : "TABLE" ,
50- "slow_query_log" : "1" ,
51- "tmp_table_size" : "32M" ,
52- "tmpdir" : "/var/lib/mysql" ,
53- "audit_log_file" : "/var/log/mysql/mysql-audit.log" ,
54- "audit_log_exclude_accounts" : "\" root@localhost,root@127.0.0.1," + utils .ReplicationUser + "@%," + utils .MetricsUser + "@%\" " ,
55- "audit_log_buffer_size" : "16M" ,
30+ "default-time-zone" : "+08:00" ,
31+ "slow_query_log_file" : "/var/log/mysql/mysql-slow.log" ,
32+ "read_only" : "ON" ,
33+ "binlog_format" : "row" ,
34+ "log-bin" : "/var/lib/mysql/mysql-bin" ,
35+ "log-timestamps" : "SYSTEM" ,
36+ "innodb_open_files" : "655360" ,
37+ "open_files_limit" : "655360" ,
38+
39+ "gtid-mode" : "ON" ,
40+ "enforce-gtid-consistency" : "ON" ,
41+ "slave_parallel_type" : "LOGICAL_CLOCK" ,
42+ "relay_log" : "/var/lib/mysql/mysql-relay-bin" ,
43+ "relay_log_index" : "/var/lib/mysql/mysql-relay-bin.index" ,
44+ "master_info_repository" : "TABLE" ,
45+ "relay_log_info_repository" : "TABLE" ,
46+ "slow_query_log" : "1" ,
47+ "tmp_table_size" : "32M" ,
48+ "tmpdir" : "/var/lib/mysql" ,
5649}
5750
58- // mysqlCommonConfigs is the map of the mysql common configs.
59- var mysqlCommonConfigs = map [string ]string {
60- "character_set_server" : "utf8mb4" ,
61- "interactive_timeout" : "3600" ,
62- "default-time-zone" : "+08:00" ,
63- "expire_logs_days" : "7" ,
64- "key_buffer_size" : "33554432" ,
65- "log_bin_trust_function_creators" : "1" ,
66- "long_query_time" : "3" ,
67- "binlog_cache_size" : "32768" ,
68- "binlog_stmt_cache_size" : "32768" ,
69- "max_connections" : "1024" ,
70- "max_connect_errors" : "655360" ,
71- "query_cache_size" : "0" ,
72- "sync_master_info" : "1000" ,
73- "sync_relay_log" : "1000" ,
74- "sync_relay_log_info" : "1000" ,
75- "table_open_cache" : "2000" ,
76- "thread_cache_size" : "128" ,
77- "wait_timeout" : "3600" ,
78- "group_concat_max_len" : "1024" ,
79- "slave_rows_search_algorithms" : "INDEX_SCAN,HASH_SCAN" ,
80- "max_allowed_packet" : "1073741824" ,
81- "event_scheduler" : "OFF" ,
82- "innodb_print_all_deadlocks" : "0" ,
83- "autocommit" : "1" ,
84- "transaction-isolation" : "READ-COMMITTED" ,
51+ var mysqlSpecialConfig = map [string ]string {
52+ "plugin-load" : "\" semisync_master.so;semisync_slave.so;audit_log.so;connection_control.so\" " ,
53+ "audit_log_file" : "/var/log/mysql/mysql-audit.log" ,
54+ "audit_log_exclude_accounts" : "\" root@localhost,root@127.0.0.1," + utils .ReplicationUser + "@%," + utils .MetricsUser + "@%\" " ,
55+ "audit_log_buffer_size" : "16M" ,
56+ "rpl_semi_sync_master_enabled" : "OFF" ,
57+ "rpl_semi_sync_slave_enabled" : "ON" ,
58+ "rpl_semi_sync_master_wait_no_slave" : "ON" ,
59+ "rpl_semi_sync_master_timeout" : "1000000000000000000" ,
60+ "audit-log" : "ON" ,
8561 "audit_log_policy" : "NONE" ,
8662 "audit_log_rotate_on_size" : "104857600" ,
8763 "audit_log_rotations" : "6" ,
64+ "audit_log_format" : "OLD" ,
8865 "connection_control_failed_connections_threshold" : "3" ,
8966 "connection_control_min_connection_delay" : "1000" ,
9067 "connection_control_max_connection_delay" : "2147483647" ,
91- "explicit_defaults_for_timestamp" : "0" ,
92- "innodb_adaptive_hash_index" : "0" ,
68+ }
69+
70+ // mysqlCommonConfigs is the map of the mysql common configs.
71+ var mysqlCommonConfigs = map [string ]string {
72+ "character_set_server" : "utf8mb4" ,
73+ "interactive_timeout" : "3600" ,
74+ "default-time-zone" : "+08:00" ,
75+ "expire_logs_days" : "7" ,
76+ "key_buffer_size" : "33554432" ,
77+ "log_bin_trust_function_creators" : "1" ,
78+ "long_query_time" : "3" ,
79+ "binlog_cache_size" : "32768" ,
80+ "binlog_stmt_cache_size" : "32768" ,
81+ "max_connections" : "1024" ,
82+ "max_connect_errors" : "655360" ,
83+ "query_cache_size" : "0" ,
84+ "sync_master_info" : "1000" ,
85+ "sync_relay_log" : "1000" ,
86+ "sync_relay_log_info" : "1000" ,
87+ "table_open_cache" : "2000" ,
88+ "thread_cache_size" : "128" ,
89+ "wait_timeout" : "3600" ,
90+ "group_concat_max_len" : "1024" ,
91+ "slave_rows_search_algorithms" : "INDEX_SCAN,HASH_SCAN" ,
92+ "max_allowed_packet" : "1073741824" ,
93+ "event_scheduler" : "OFF" ,
94+ "innodb_print_all_deadlocks" : "0" ,
95+ "autocommit" : "1" ,
96+ "transaction-isolation" : "READ-COMMITTED" ,
97+
98+ "explicit_defaults_for_timestamp" : "0" ,
99+ "innodb_adaptive_hash_index" : "0" ,
93100}
94101
95102// mysqlStaticConfigs is the map of the mysql static configs.
96103// The mysql need restart, if modify the config.
97104var mysqlStaticConfigs = map [string ]string {
98- "audit_log_format" : "OLD" ,
105+
99106 "default-storage-engine" : "InnoDB" ,
100107 "back_log" : "2048" ,
101108 "ft_min_word_len" : "4" ,
0 commit comments