mysql中主从复制配置文件_MySQL主从复制 配置文件实例
1、主服务器配置文件
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# datadir = /usr/local/mysql/data
# Server
port=3306
socket=/tmp/mysql.sock
basedir=/usr/local/mysql
datadir = /var/lib/mysql
open_files_limit=10240
explicit_defaults_for_timestamp
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
federated
server_id=1
max_connections=1000
max_connect_errors=100000
interactive_timeout=86400
wait_timeout=86400
skip-name-resolve
sync_binlog=0
# Master
log-slave-updates=true
gtid-mode=on
enforce-gtid-consistency=true
master-info-repository=TABLE
relay-log-info-repository=TABLE
sync-master-info=1
slave-parallel-workers=2
binlog-checksum=CRC32
master-verify-checksum=1
slave-sql-verify-checksum=1
binlog-rows-query-log_events=1
report-port=3306
# Buffer
sort_buffer_size=2m
read_buffer_size=2m
read_rnd_buffer_size=2m
join_buffer_size=2m
net_buffer_length=16k
max_allowed_packet=512m
bulk_insert_buffer_size=32m
max_heap_table_size=512m
tmp_table_size=512m
thread_cache_size=300
query_cache_size=128m
query_cache_limit=1m
query_cache_min_res_unit=4k
key_buffer_size=16m
myisam_sort_buffer_size=64m
myisam_max_sort_file_size=10g
myisam_repair_threads=1
# Log
log-bin=mysql-bin
binlog_cache_size=32m
max_binlog_cache_size=64m
binlog_stmt_cache_size=32m
table_open_cache=2048
max_binlog_size=512m
binlog_format=ROW
log_output=FILE
slow_query_log=1
slow_query_log_file=slow_query.log
general_log=0
general_log_file=general_query.log
expire-logs-days=2
relay-log=relay-bin
relay-log-index=relay-bin.index
# Innodb
innodb_data_file_path=ibdata1:2048M:autoextend
innodb_log_file_size=128m
innodb_log_files_in_group=3
innodb_buffer_pool_size=5g
innodb_buffer_pool_instances=-1
innodb_max_dirty_pages_pct=70
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT
innodb_log_buffer_size=16m
innodb_flush_log_at_trx_commit=2
2、从服务配置文件
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# Server
port=3306
socket=/tmp/mysql.sock
basedir=/usr/local/mysql
datadir=/var/lib/mysql
open_files_limit=10240
explicit_defaults_for_timestamp
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
federated
server_id=10
max_connections=1000
max_connect_errors=100000
interactive_timeout=86400
wait_timeout=86400
skip-name-resolve
sync_binlog=0
# Log
log-bin=/zabbixdb/mysql_slave_log/mysql-bin
binlog-format=ROW
binlog-checksum=CRC32
binlog-rows-query-log_events=1
binlog_cache_size=32m
binlog_stmt_cache_size=32m
max_binlog_cache_size=64m
max_binlog_size=512m
log_output=FILE
table_open_cache=2048
slow_query_log=1
slow_query_log_file=/zabbixdb/mysql_slave_log/slow_query.log
general_log=0
general_log_file=/zabbixdb/mysql_slave_log/general.log
relay-log=/zabbixdb/mysql_slave_log/relay-log
relay-log-index=/zabbixdb/mysql_slave_log/relay-log.index
relay-log-info-repository=TABLE
expire_logs_days=1
# Slave
log-slave-updates=true
gtid-mode=on
enforce-gtid-consistency=true
master-info-repository=TABLE
master-verify-checksum=1
sync-master-info=1
slave-parallel-workers=2
slave-sql-verify-checksum=1
report-port=3306
# Innodb
innodb_data_file_path=ibdata1:2048M:autoextend
innodb_log_file_size=128m
innodb_log_files_in_group=3
innodb_buffer_pool_size=2g
innodb_buffer_pool_instances=-1
innodb_max_dirty_pages_pct=70
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT
innodb_log_buffer_size=16m
innodb_flush_log_at_trx_commit=2
mysql中主从复制配置文件_MySQL主从复制 配置文件实例相关推荐
- mysql 主从复制讲解_MySQL主从复制详解
前言: 在MySQL中,主从架构应该是最基础.最常用的一种架构了.后续的读写分离.多活高可用架构等大多都依赖于主从复制.主从复制也是我们学习MySQL过程中必不可少的一部分,关于主从复制的文章有很多, ...
- mysql主从复制(master-slave)_mysql主从复制------Master-Slave搭建及注意事项
前言 关于mysql主从复制的原理实际上是很通俗易懂的,可是,在实际的搭建这个结构的时候,仍是会遇到不一样的状况的.因而下面介绍的是搭建Master-Slave的操做及注意事项,本文不含数据库的调优参 ...
- mysql 组复制 不一致_MySQL主从复制什么原因会造成不一致,如何预防及解决
#目录MySQL主从复制什么原因会造成不一致,如何预防及解决? 你为什么会决定进行分库分表,分库分表过程中遇到什么难题,如何解决的? MySQL高可用架构应该考虑什么? 你认为应该如何设计? MySQ ...
- mysql的主从复制优缺点_MySQL主从复制原理,超级详细的总结,看完全通了
主从复制的方式 主从复制分为:异步复制,半同步复制和全同步复制 异步复制: 是MySQL默认的复制模式,主库在执行完客户端提交的事务之后会立刻将结果返回给客户端,并不关心从库接收的结果,这样就会导致当 ...
- mysql中charset()作用_Mysql系列(四) —— MySQL的Charset和Collation
一.内容概述 在MySQL的使用过程中,了解字符集.字符序的概念,以及不同设置对数据存储.比较的影响非常重要.不少同学在日常工作中遇到的"乱码"问题,很有可能就是因为对字符集与字符 ...
- MySQL中你可能忽略的COLLATION实例详解
文章来源: 学习通http://www.bdgxy.com/ 普学网http://www.boxinghulanban.cn/ 智学网http://www.jaxp.net/ 前言 MySQL 数据库 ...
- mysql中中文显示_MySQL显示中文
http://www.cnblogs.com/livingintruth/p/3433259.html 这两天在学习webpy,把webpy的一个blog例子扒下来学习一下,默认创建的table当存入 ...
- mysql中连接运算符_MySQL的运算符
1.算术运算 运算符 作用 + 加法 - 减法 * 乘法 / (div) 除法 (整除) % (mod) 求余 运算代码 结果 运算代码 结果 select -4/-3; //1.3333 selec ...
- mysql中数字格式化_mysql中格式化数字详解
最近因为工作的需求,需要对mysql中数字进行格式化,但发现网上的资料较少,索性自己总结一下,方便自己也帮助有需要的朋友们,下面话不多说,来一起看看详细的介绍: 一.format函数: 格式化浮点数 ...
- mysql中int(m)_mysql中int(M) tinyint(M)中M的作用
原先对mysql不太理解,但也没有报错.但理解的不够深入.这次补上. 原来以为int(11)是指11个字节,int(10)就是10个字节.我错了. http://zhidao.baidu.com/li ...
最新文章
- AI一分钟|美团推出无人配送开放平台,有望提高配送效率;福特成立自动驾驶汽车公司,投资40亿美元...
- 两个月入门深度学习,全靠动手实践!一位前端小哥的经验分享
- 2019年上海市数学建模讲座笔记(2)概率统计模型
- VTK修炼之道14:图像处理_创建
- 【论文浅析】Semi-supervised sequence tagging with bidirectional lm
- 使用Golang搭建gRPC服务提供给.NetCore客户端调用
- am335x reboot 命令分析
- 中国联通回应裁员传闻:严重不实 勿传勿信
- Self-introduction (自我介绍)
- 后悔当初没考研。。。
- Gitlab的使用(内含Git命令大全)
- plc变频器c语言,PLC控制变频器的几种方法
- 开源组织之FSF与OSI,开源协议之BSD、GPL、APACHE
- VS解决方案文件格式说明
- android wear 应用推荐,2015年Android Wear十大必装应用
- 什么是搜索引擎优化(SEO)
- 第一章 阿里大数据产品体系
- 大4女生想做软件测试岗,如何系统性学习测试呢?
- vscode造成c盘空间占用剧增
- linux win10双系统启动顺序,Windows 10 和 Ubuntu 20.04 双系统 GRUB2 默认启动项的更改...
热门文章
- java连加密的mysql_Java 实现加密数据库连接
- android 自定义透明 等待 dialog,Android自定义Dialog内部透明、外部遮罩效果
- adurnio 单片机_单片机20~200A大电流检测电路设计 用AD实现 带原理图,源代码,proteus仿真文件...
- java模块化按需加载,JavaScript模块化之使用requireJS按需加载
- paypal创建订单后怎么获得id_5步创建Facebook商店(最新版教程)学习如何在Facebook上卖货...
- python中标识符的命名规则_Python——标识符的命名规则
- python arduino c_从Python向Arduino LCD发送一个字符串
- php中文歌词,html如何制作滚动歌词
- 3090显卡 torch.cuda.is_available()返回false的解决办法
- MySQL 之binlog日志说明及利用binlog日志恢复数据操作记录