mysql主库与从库配置(并行复制配置)
主库:
[mysqld]
server-id = 2233
port = 13306
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /usr/local/mysql/mysql.sock
pid-file=/usr/local/mysql/data/mysql.pid
skip-external-locking
skip_name_resolve = 0
skip-slave-start
transaction_isolation = REPEATABLE-READ
character-set-server = utf8
collation-server = utf8_general_ci
init_connect='SET NAMES utf8'
lower_case_table_names = 1
max_connections = 2000
max_connect_errors = 1000
max_allowed_packet = 24M
open_files_limit=65536
max_prepared_stmt_count=1048576
tmp_table_size = 256M
max_heap_table_size = 256M
query_cache_size = 128M
query_cache_type = 1
query_cache_limit=4M
sort_buffer_size = 2M #线程缓存
binlog_cache_size = 5242880
back_log = 130
log_timestamps=SYSTEM
log-error=/usr/local/mysql/data/mysqld.log
log-bin=mysql-bin
binlog_rows_query_log_events=1
log_bin_trust_function_creators=1
table_open_cache=2000
innodb_open_files=1024
binlog_format = row
gtid_mode=ON
enforce-gtid-consistency
innodb_flush_log_at_trx_commit = 1
sync_binlog = 0
innodb_buffer_pool_size = 6G
innodb_file_per_table=1
innodb_data_file_path = ibdata1:12M;ibdata2:1G:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size=512M
innodb_log_files_in_group=3
innodb_log_buffer_size = 128M
innodb_io_capacity=800
innodb_adaptive_flushing=1
innodb_support_xa = ON
innodb_read_io_threads=12
innodb_write_io_threads=12
#auto_increment_offset=1
#auto_increment_increment=2
innodb_lock_wait_timeout = 100
innodb_large_prefix = 1
innodb_purge_threads = 4
#innodb_print_all_deadlocks = 1
innodb_buffer_pool_dump_at_shutdown=on
innodb_buffer_pool_load_at_startup=ON
innodb_buffer_pool_dump_now=ON
innodb_buffer_pool_load_now=ON
innodb_thread_concurrency=0
innodb_read_ahead_threshold=42
innodb_change_buffering=all
innodb_change_buffer_max_size=30
secure-file-priv=''
[mysqldump]
quick
max_allowed_packet = 24M
[mysql]
auto-rehash #使用TAB键自动补全
[mysqld_safe]
open-files-limit = 65536
从库:
[mysqld]
server-id = 2233
port = 13306
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /usr/local/mysql/mysql.sock
pid-file=/usr/local/mysql/data/mysql.pid
skip-external-locking
skip_name_resolve = 0
skip-slave-start
transaction_isolation = REPEATABLE-READ
character-set-server = utf8
collation-server = utf8_general_ci
init_connect='SET NAMES utf8'
lower_case_table_names = 1
max_connections = 2000
max_connect_errors = 1000
max_allowed_packet = 24M
open_files_limit=65536
max_prepared_stmt_count=1048576
tmp_table_size = 256M
max_heap_table_size = 256M
query_cache_size = 128M
query_cache_type = 1
query_cache_limit=4M
sort_buffer_size = 2M #线程缓存
binlog_cache_size = 5242880
back_log = 130
log_timestamps=SYSTEM
log-error=/usr/local/mysql/data/mysql-err.log
log-bin=mysql-bin
binlog_rows_query_log_events=1
log_bin_trust_function_creators=1
table_open_cache=2000
innodb_open_files=1024
binlog_format = row
relay_log_recovery = 1
relay-log=mysql-relay
slave_skip_errors = all
slave_net_timeout=60
#replicate-do-db =
replicate-ignore-db = mysql
#并行复制参数
slave-parallel-type=LOGICAL_CLOCK
#slave_preserve_commit_order开启时slave-parallel-typ必须为LOGICAL_CLOCK,保证顺序执行语句。
slave_preserve_commit_order=1
slave-parallel-workers=8
master_info_repository = TABLE
relay_log_info_repository = TABLE
gtid_mode=ON
#将mster的记录到slave的二进制日志文件中
log-slave-updates=ON
enforce-gtid-consistency
innodb_flush_log_at_trx_commit = 1
sync_binlog = 0
innodb_buffer_pool_size = 6G
innodb_file_per_table=1
innodb_data_file_path = ibdata1:12M;ibdata2:1G:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size=512M
innodb_log_files_in_group=3
innodb_log_buffer_size = 128M
innodb_io_capacity=800
innodb_adaptive_flushing=1
innodb_support_xa = ON
innodb_read_io_threads=12
innodb_write_io_threads=12
#auto_increment_offset=1
#auto_increment_increment=2
innodb_lock_wait_timeout = 100
innodb_large_prefix = 1
innodb_purge_threads = 4
#innodb_print_all_deadlocks = 1
innodb_buffer_pool_dump_at_shutdown=on
innodb_buffer_pool_load_at_startup=ON
innodb_buffer_pool_dump_now=ON
innodb_buffer_pool_load_now=ON
innodb_thread_concurrency=0
innodb_read_ahead_threshold=42
innodb_change_buffering=all
innodb_change_buffer_max_size=30
secure-file-priv=''
[mysqldump]
quick
max_allowed_packet = 24M
[mysql]
auto-rehash #使用TAB键自动补全
[mysqld_safe]
open-files-limit = 65536
mysql主库与从库配置(并行复制配置)的更多相关文章
- MySQL5.7 并行复制配置
转自:https://www.cnblogs.com/langdashu/p/6125621.html [MySQL] 号称永久解决了复制延迟问题的并行复制,MySQL5.7 一.缘由: 某天看到主从 ...
- 5.7 并行复制配置 基于GTID 搭建中从 基于GTID的备份与恢复,同步中断处理
5.7 并行复制配置 基于GTID 搭建中从 基于GTID的备份与恢复,同步中断处理 这个文章包含三个部分 1:gtid的多线程复制2:同步中断处理3:GTID的备份与恢复 下面文字相关的东西 大部分 ...
- MySQL 5.7 基于GTID主从复制+并行复制+半同步复制
环境准备 IP HOSTNAME SERVICE SYSTEM 192.168.131.129 mysql-master1 mysql CentOS7.6 192.168.131.130 mysql- ...
- MySQL实现主从库,AB复制配置
AB复制是一种数据复制技术,是myslq数据库提供的一种高可用.高性能的解决方案. AB复制的模式:一主一从 .一主多从.双主.多主多从 复制的工作原理:要想实现ab复制,那么前提是master上必须 ...
- 【MySQL】你以为设置了并行复制就降低延迟了?这个你绝对想不到!
在MySQL官方版本中,为了保证其的高可用性,一般情况我们会采用主从复制的方式来解决.当然,方法很多.而我们今天所要处理的是采用GTID方式并且开了多线程复制后,仍然延迟的情况,糟糕的是,延迟还在不断 ...
- MySQL Bug剖析之Slave节点并行复制死锁
此文已由作者温正湖授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 有天一早,DBA同学就找上来了,说有个DDB集群下的RDS实例Slave节点(从库)死锁了,请求支援.说实话 ...
- MySQL的并行复制多线程复制MTS(Multi-Threaded Slaves)
MySQL的并行复制多线程复制MTS(Multi-Threaded Slaves) http://www.tuicool.com/articles/m2Unmeq 姜承饶 简称MTS:基于binlog ...
- MySQL 5.7基于组提交的并行复制
参考链接: http://mysql.taobao.org/monthly/2016/08/01/ https://www.kancloud.cn/thinkphp/mysql-parallel-ap ...
- MySQL并行复制(MTS)原理(完整版)
目录 MySQL 5.6并行复制架构 MySQL 5.7并行复制原理 Master 组提交(group commit) 支持并行复制的GTID slave LOGICAL_CLOCK(由order c ...
随机推荐
- (博弈论 高精度小数)51NOD 1185 威佐夫游戏 V2
有2堆石子.A B两个人轮流拿,A先拿.每次可以从一堆中取任意个或从2堆中取相同数量的石子,但不可不取.拿到最后1颗石子的人获胜.假设A B都非常聪明,拿石子的过程中不会出现失误.给出2堆石子的数量, ...
- ls -l 详解
ls -l 是文件系统的一个命令,用来查询当前路径的文件的属性.大小等详细信息
- [Usaco2005 Nov]Asteroids
Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape o ...
- 51nod 1119 机器人走方格 V2
1119 机器人走方格 V2 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注 M * N的方格,一个机器人从左上走到右下,只能向右或向下走.有多少 ...
- 220 Contains Duplicate III 存在重复 III
给定一个整数数组,判断数组中是否有两个不同的索引 i 和 j,使 nums [i] 和 nums [j] 的绝对差值最大为 t,并且 i 和 j 之间的绝对差值最大为 k. 详见:https://le ...
- 018 [工具软件]截图贴图注释 Snipaste
Snipaste 是一个截图贴图工具,绿色免费.官方主页:https://zh.snipaste.com/. 三大功能: 1.截图,可以自动识别窗口的各元素,可以精准到像素调整截图区域大小. 2.贴图 ...
- WCF入门大致思路
WCF服务: 1.IServer.cs(类似接口,WCF接口) 2.Server.svc(实现了WCF接口)右键浏览器运行可以看到WCF服务链接,类似(http://localhost:4609/Us ...
- hihocoder 神奇字符串
思路: 暴力,模拟. 实现: #include <iostream> #include <algorithm> #include <cstdio> #include ...
- 学习笔记 第十三章 使用CSS3新布局
第13章 使用CSS3新布局 [学习重点] 设计多列布局 设计弹性盒布局样式 使用CSS3布局技术设计适用移动需求的网页 13.1 多列布局 CSS3使用columns属性定义多列布局,用法如下 ...
- iOS programming Delegation and Text Input
iOS programming Delegation and Text Input 1.1 Text Fields CGRect textFieldRect = CGRectMake(40, ...