一、软件版本
Percona Mysql 7.7
二、配置内容
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208 # Configuration name MysqlServer-Master generated for dingkaimx@163.com at 2018-04-18 13:48:46 [mysql] # CLIENT # port = 3306 #监听端口 socket = /opt/mysql/mysql_log/mysql.sock #socket文件 可用于连接mysql [mysqld] # GENERAL # user = mysql #运行mysql的用户 default-storage-engine = InnoDB #默认存储引擎 socket = /opt/mysql/mysql_log/mysql.sock pid-file = /opt/mysql/mysql_log/mysql.pid #程序pid server-id = 1001 #各个实例不能相同 # MyISAM # key-buffer-size = 32M myisam-recover-options = FORCE,BACKUP # SAFETY # max-allowed-packet = 16M max-connect-errors = 1000000 skip-name-resolve sql-mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY innodb = FORCE # DATA STORAGE # datadir = /opt/mysql/mysql_data/ #数据存储目录 # BINARY LOGGING # log-bin = /opt/mysql/mysql_log/mysql-bin #bin-log文件路径 expire-logs-days = 30 #bin-log日志保留天数 sync-binlog = 1 #每次变更操作写入bin-log后 立即刷新磁盘 binlog_format = ROW #bin-log格式 # REPLICATION # gtid_mode = ON #开启GTID enforce_gtid_consistency = ON #开启GTID relay-log = /opt/mysql/mysql_log/relay-bin #relag-log的位置 relay_log_info_repository = TABLE #可选值为“FILE”、“TABLE”,用于保存slave读取relay log的位置信息,以便crash重启后继续恢复;“FILE”表示将信息写入relay-log.info文件,“TABLE”表示将信息写入mysql.slave_relay_log_info表中 sync-relay-log = 1 #当设置为1时,slave的I/O线程每次接收到master发送过来的binlog日志都要写入系统缓冲区,然后刷入relay log中继日志里 sync-relay-log-info = 1 #启用之可确保无信息丢失 master_info_repository = TABLE #用于实现在崩溃时保证二进制及从服务器安全的功能 sync-master-info = 1 #启用之可确保无信息丢失 # SLAVE # #log_slave_updates = ON #当从节点作为其他节点的主节点时需要开启 #read-only = 1 #开启从库只读 #slave-net-timeout = 60 #从库认为主库在60s内不更新数据就挂了 #skip-slave-start = 1 #启动mysql时不启动主从复制,需要手动 start salve # CACHES AND LIMITS # tmp-table-size = 32M max-heap-table-size = 32M query-cache-type = 0 query-cache-size = 0 max-connections = 500 thread-cache-size = 50 open-files-limit = 65535 table-definition-cache = 4096 table-open-cache = 4096 # INNODB # innodb-flush-method = O_DIRECT innodb-log-files-in-group = 2 innodb-log-file-size = 512M innodb-flush-log-at-trx-commit = 1 innodb-file-per-table = 1 innodb-buffer-pool-size = 26G # LOGGING # log-error = /opt/mysql/mysql_log/mysql-error.log log-queries-not-using-indexes = 1 slow-query-log = 1 slow-query-log-file = /opt/mysql/mysql_log/mysql-slow.log