-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy.cnf
105 lines (95 loc) · 2.88 KB
/
my.cnf
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
# author : Bilery Zoo([email protected])
# date : 2021-04-24
# This option file(--defaults-file) is generally configured for MySQL 8.0.24
# Hardware relevant args are set based on IBM Cloud VM(CentOS8) 'BL2.2x8' set menu (2 CPUs & 8G MEMs)
[client]
default-character-set = utf8mb4
socket = /usr/local/mysql/data/mysql.sock
[mysql]
no-auto-rehash
default-character-set = utf8mb4
[mysqld]
## file system
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /usr/local/mysql/data/mysql.sock
mysqlx_socket = /usr/local/mysql/data/mysqlx.sock
pid-file = /usr/local/mysql/data/mysql.pid
log_error = /usr/local/mysql/data/mysql.err
log-bin = /usr/local/mysql/data/mysql-bin
relay_log = /usr/local/mysql/data/mysql-relay-bin
log-bin-index = /usr/local/mysql/data/mysql-bin.index
relay_log_index = /usr/local/mysql/data/mysql-relay-bin.index
slow_query_log_file = /usr/local/mysql/data/mysql-slow.log
## server general config
back_log = 1024
skip_name_resolve = ON
log_timestamps = SYSTEM
log_error_verbosity = 3
lower_case_table_names = 1
default-time-zone = '+9:00'
character_set_server = utf8mb4
plugin-load-add = mysql_clone.so
## timeout args
wait_timeout = 600
interactive_timeout = 600
mysqlx_wait_timeout = 600
mysqlx_interactive_timeout = 600
## slow log
log_output = FILE
slow_query_log = ON
long_query_time = 10
log_slow_admin_statements = ON
log_queries_not_using_indexes = ON
log_throttle_queries_not_using_indexes = 24
## correlation args
open_files_limit = 65535
table_open_cache = 65535
innodb_open_files = 65535
table_definition_cache = 65535
# InnoDB general config
## hardware rely(CPUs & MEMs)
innodb_purge_threads = 6
innodb_page_cleaners = 6
innodb_read_io_threads = 6
innodb_write_io_threads = 6
innodb_buffer_pool_size = 6G
innodb_buffer_pool_instances = 6
innodb_io_capacity = 4096
innodb_io_capacity_max = 8192
innodb_print_all_deadlocks = ON
innodb_log_buffer_size = 64M
innodb_log_file_size = 2G
innodb_log_files_in_group = 3
innodb_data_file_path = ibdata0:1G;ibdata1:1G;ibdata2:1G;ibdata3:1G:autoextend
## async replication
server-id = 1024
report_host = 192.168.67.128
gtid_mode = ON
binlog_format = ROW
relay_log_purge = ON
log_slave_updates = ON
relay_log_recovery = ON
slave_parallel_workers = 6
enforce_gtid_consistency = ON
slave_transaction_retries = 256
slave_preserve_commit_order = ON
slave_parallel_type = LOGICAL_CLOCK
binlog_expire_logs_seconds = 604800
explicit_defaults_for_timestamp = ON
transaction_write_set_extraction = XXHASH64
binlog_transaction_dependency_tracking = WRITESET
## high availability config
sync_binlog = 1
innodb_doublewrite = ON
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 1
binlog_group_commit_sync_delay = 0
binlog_group_commit_sync_no_delay_count = 0
## PMM
performance_schema = ON
innodb_monitor_enable = all
performance-schema-instrument = 'statement/%=ON'
performance-schema-consumer-statements-digest = ON
[mysqldump]
quick