1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
| mkdir -p /data/mysql/{log,binlog,relaylog} [mysqld] user=mysql port=3306 basedir=/data/mysql datadir=/data/mysql/data symbolic-links=0 open_files_limit = 65535 server_id=63
gtid_mode=on enforce_gtid_consistency=on log-slave-updates=on
master-info-repository=TABLE relay-log-info-repository=TABLE relay_log_recovery=1
auto-increment-increment=2 auto-increment-offset=1
sync_relay_log=1 sync_relay_log_info=1 sync_master_info=1
innodb_buffer_pool_size=32G
innodb_log_file_size=1G
innodb_log_buffer_size=64M
innodb_flush_method=O_DIRECT
innodb_thread_concurrency=0
innodb_io_capacity=2000 innodb_io_capacity_max=4000
innodb_flush_neighbors=0
innodb_adaptive_hash_index=ON
innodb_file_format=Barracuda innodb_file_per_table=ON
innodb_temp_data_file_path=ibtmp1:200M:autoextend
max_connections=5000
max_user_connections=4000
max_connect_errors=100000
wait_timeout=600 interactive_timeout=600
thread_cache_size=256
table_open_cache=4000 table_definition_cache=2000
max_binlog_size=1G log-bin=/data/mysql/binlog/mysql-bin relay_log=/data/mysql/relaylog/mysql-relay-bin
binlog_format=ROW
binlog_cache_size=1M
expire_logs_days=30 sync_binlog=1
slow_query_log=1 long_query_time=10 log_output=FILE slow_query_log_file=/data/mysql/log/mysql-slow.log general_log = OFF
log_error=/data/mysql/log/mysql-error.log
character_set_server=utf8mb4
default_time_zone='+8:00' log_timestamps=SYSTEM
lower_case_table_names=1
max_allowed_packet=1G
tmp_table_size=64M max_heap_table_size=64M
sort_buffer_size=4M read_buffer_size=4M read_rnd_buffer_size=4M join_buffer_size=4M
transaction-isolation=READ-COMMITTED
log_bin_trust_function_creators=1
plugin_dir=/usr/lib64/mysql/plugin
plugin_load="rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so" rpl_semi_sync_master_enabled=1 rpl_semi_sync_slave_enabled=1 rpl_semi_sync_master_timeout=3000
|