MySQL 5.7.19組複製搭建
阿新 • • 發佈:2019-02-04
[mysqld3306]
port = 3306
socket = /home/mysql/data/mysql.sock
# GENERAL #
user = mysql
default-storage-engine = InnoDB
pid-file=/home/mysql/data/mysqld.pid
server-id = 2
tmpdir = /mysqltmp/
log-error=/usr/local/mysql/mysqld.log
character_set_server = utf8
default-time-zone = '+8:00'
max_allowed_packet = 4M
event_scheduler = 1
# MyISAM #
key-buffer-size = 32M
bulk_insert_buffer_size = 512M
myisam_sort_buffer_size = 512M
myisam_max_sort_file_size = 1G
myisam_repair_threads = 1
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
sql-mode =
sysdate-is-now = 1
innodb = FORCE
# DATA STORAGE #
datadir = /home/mysql/data/
#datadir = /home/mysql/dataUp/
# BINARY LOGGING #
log-bin = /binlog/mysql-bin
expire-logs-days = 30
sync-binlog = 1
lower_case_table_names = 1
binlog_format = row
max_binlog_size = 1073741824
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 2000
thread-cache-size = 128
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
# INNODB #
query_cache_size = 0
max_heap_table_size = 96M
tmp_table_size = 96M
long_query_time = 1
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 1G
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_purge_threads = 4
innodb_buffer_pool_instances = 3
innodb_stats_on_metadata = OFF
join_buffer_size = 262144
sort_buffer_size = 262144
innodb_support_xa = 1
default-storage-engine =innodb
innodb_io_capacity=1000
innodb_open_files = 500
innodb_doublewrite=0
innodb_file_format=Barracuda
innodb_thread_concurrency= 0
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
# LOGGING #
log-error = /home/mysql/data/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /home/mysql/data/mysql-slow.log
# REPLICATION #
slave_compressed_protocol = on
sync_relay_log_info = 10000
log-slave-updates = 1
relay-log = /home/mysql/data/relay-bin
relay_log_recovery = 1
binlog_gtid_simple_recovery = 1
slave-net-timeout = 60
sync_master_info = 1
sync-relay-log = 1
sync-relay-log-info = 1
master_info_repository = TABLE
relay_log_info_repository = TABLE
slave_skip_errors = ddl_exist_errors
binlog_checksum=NONE
replicate-ignore-db=information_schema
replicate-ignore-db=mysql
replicate-ignore-db=performance_schema
replicate-ignore-db=sys
replicate-ignore-db=dmm_170401
replicate-ignore-db=sqlauditbo
# semi sync replication settings #
plugin_dir = /usr/local/mysql/lib/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 = 5000
# GTID #
gtid_mode = on
enforce_gtid_consistency = on
# SLOW LOG #
slow_query_log=ON
#slow_query_log_file=/home/mysql/data/SlaveSed-slow.log
long_query_time=5
########group replication##############
relay_log_info_repository=TABLE
master_info_repository=table
binlog_checksum=NONE
log_slave_updates=ON
binlog_format=ROW
gtid_mode=ON
transaction_write_set_extraction=XXHASH64
slave_parallel_type=LOGICAL_CLOCK
slave_preserve_commit_order=1
loose-group_replication_group_name = 'ce9be252-2b71-11e6-b8f4-00212889f851'
loose-group_replication_start_on_boot = off
loose-group_replication_bootstrap_group = off
loose-group_replication_local_address = '192.168.56.115:33061'
loose-group_replication_group_seeds ='192.168.56.117:33061,192.168.56.115:33061,192.168.56.115:33071'
loose-group_replication_single_primary_mode = off
loose-group_replication_enforce_update_everywhere_checks = on
group_replication_ssl_mode=REQUIRED
####################### SLAVE PARAMETER #####################
#read_only=1
#super_read_only=1
####################### mysql 57 #####################
slave_parallel_type=LOGICAL_CLOCK
slave_parallel_workers=4
rpl_semi_sync_master_wait_point = after_sync
rpl_semi_sync_master_wait_for_slave_count = 1
port = 3306
socket = /home/mysql/data/mysql.sock
# GENERAL #
user = mysql
default-storage-engine = InnoDB
pid-file=/home/mysql/data/mysqld.pid
server-id = 2
tmpdir = /mysqltmp/
log-error=/usr/local/mysql/mysqld.log
character_set_server = utf8
default-time-zone = '+8:00'
max_allowed_packet = 4M
event_scheduler = 1
# MyISAM #
key-buffer-size = 32M
bulk_insert_buffer_size = 512M
myisam_sort_buffer_size = 512M
myisam_max_sort_file_size = 1G
myisam_repair_threads = 1
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
sql-mode =
sysdate-is-now = 1
innodb = FORCE
# DATA STORAGE #
datadir = /home/mysql/data/
#datadir = /home/mysql/dataUp/
# BINARY LOGGING #
log-bin = /binlog/mysql-bin
expire-logs-days = 30
sync-binlog = 1
lower_case_table_names = 1
binlog_format = row
max_binlog_size = 1073741824
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 2000
thread-cache-size = 128
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
# INNODB #
query_cache_size = 0
max_heap_table_size = 96M
tmp_table_size = 96M
long_query_time = 1
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 1G
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_purge_threads = 4
innodb_buffer_pool_instances = 3
innodb_stats_on_metadata = OFF
join_buffer_size = 262144
sort_buffer_size = 262144
innodb_support_xa = 1
default-storage-engine =innodb
innodb_io_capacity=1000
innodb_open_files = 500
innodb_doublewrite=0
innodb_file_format=Barracuda
innodb_thread_concurrency= 0
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
# LOGGING #
log-error = /home/mysql/data/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /home/mysql/data/mysql-slow.log
# REPLICATION #
slave_compressed_protocol = on
sync_relay_log_info = 10000
log-slave-updates = 1
relay-log = /home/mysql/data/relay-bin
relay_log_recovery = 1
binlog_gtid_simple_recovery = 1
slave-net-timeout = 60
sync_master_info = 1
sync-relay-log = 1
sync-relay-log-info = 1
master_info_repository = TABLE
relay_log_info_repository = TABLE
slave_skip_errors = ddl_exist_errors
binlog_checksum=NONE
replicate-ignore-db=information_schema
replicate-ignore-db=mysql
replicate-ignore-db=performance_schema
replicate-ignore-db=sys
replicate-ignore-db=dmm_170401
replicate-ignore-db=sqlauditbo
# semi sync replication settings #
plugin_dir = /usr/local/mysql/lib/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 = 5000
# GTID #
gtid_mode = on
enforce_gtid_consistency = on
# SLOW LOG #
slow_query_log=ON
#slow_query_log_file=/home/mysql/data/SlaveSed-slow.log
long_query_time=5
########group replication##############
relay_log_info_repository=TABLE
master_info_repository=table
binlog_checksum=NONE
log_slave_updates=ON
binlog_format=ROW
gtid_mode=ON
transaction_write_set_extraction=XXHASH64
slave_parallel_type=LOGICAL_CLOCK
slave_preserve_commit_order=1
loose-group_replication_group_name = 'ce9be252-2b71-11e6-b8f4-00212889f851'
loose-group_replication_start_on_boot = off
loose-group_replication_bootstrap_group = off
loose-group_replication_local_address = '192.168.56.115:33061'
loose-group_replication_group_seeds ='192.168.56.117:33061,192.168.56.115:33061,192.168.56.115:33071'
loose-group_replication_single_primary_mode = off
loose-group_replication_enforce_update_everywhere_checks = on
group_replication_ssl_mode=REQUIRED
####################### SLAVE PARAMETER #####################
#read_only=1
#super_read_only=1
####################### mysql 57 #####################
slave_parallel_type=LOGICAL_CLOCK
slave_parallel_workers=4
rpl_semi_sync_master_wait_point = after_sync
rpl_semi_sync_master_wait_for_slave_count = 1