主节点配置文件
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
secure-file-priv= NULL
server-id=100
log-bin=mysql-bin
max_connections=500
character-set-server=utf8
default_authentication_plugin=mysql_native_password
default-time-zone='+08:00'
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
#0-每隔一秒刷新一次,1-每次提交事务都刷新,2-先落到系统日志,每隔一秒刷新io缓存
innodb_flush_log_at_trx_commit=1
#每次事务提交时,binlog日志的变更刷入磁盘
sync_binlog=1
#开启慢查询日志
slow_query_log=on
slow_query_log_file=/var/lib/mysql/db-slow.log
#最长查询的秒数
long_query_time=5
# Custom config should go here
!includedir /etc/mysql/conf.d/
从节点配置文件
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
secure-file-priv= NULL
server-id=101
## 开启二进制日志功能,以备Slave作为其它Slave的Master时使用
log-bin=mysql-bin
## relay_log配置中继日志
relay_log=edu-mysql-relay-bin
max_connections=500
character-set-server=utf8
default_authentication_plugin=mysql_native_password
# Custom config should go here
default-time-zone='+08:00'
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
#0-每隔一秒刷新一次,1-每次提交事务都刷新,2-先落到系统日志,每隔一秒刷新io缓存
innodb_flush_log_at_trx_commit=1
#每次事务提交时,binlog日志的变更刷入磁盘
sync_binlog=1
#开启慢查询日志
slow_query_log=on
slow_query_log_file=/var/lib/mysql/db-slow.log
#最长查询的秒数
long_query_time=5
!includedir /etc/mysql/conf.d/