MySQL 5.6&5.7配置文件(姜总提供)
[mysql]
default-character-set=utf8mb4
user = root
password = 123456
port = 3306
socket = /tmp/mysqld.sock
prompt="\u@\h \d>"
[mysqld]
# basic settings #
user = mysql
bind-address = 0.0.0.0
socket = /tmp/mysqld.sock
character_set_server = utf8mb4
transaction_isolation = READ-COMMITTED
explicit_defaults_for_timestamp = 1
max_allowed_packet = 67108864
max_long_data_size = 67108864
event_scheduler = 1
default_password_lifetime = 0
autocommit = 1
server-id = 1
sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
# connection #
interactive_timeout = 1800
wait_timeout = 1800
lock_wait_timeout = 1800
skip_name_resolve = 1
max_connections = 1024
max_user_connections = 256
max_connect_errors = 1000000
# table cache performance settings #
table_open_cache = 4096
table_definition_cache = 4096
table_open_cache_instances = 64
# session memory settings #
read_buffer_size = 16M
read_rnd_buffer_size = 32M
sort_buffer_size = 32M
tmp_table_size = 64M
join_buffer_size = 128M
thread_cache_size = 64
# log settings #
log_error = error.log
log-bin = mysql-bin
slow_query_log = 1
slow_query_log_file = slow.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_throttle_queries_not_using_indexes = 10
expire_logs_days = 30
long_query_time = 2
min_examined_row_limit = 100
binlog-rows-query-log-events = 1
log-bin-trust-function-creators = 1
log-slave-updates = 1
log_timestamps = system
# innodb settings #
innodb_page_size = 16384
innodb_buffer_pool_size = 160G
innodb_buffer_pool_instances = 16
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_lru_scan_depth = 4096
innodb_lock_wait_timeout = 5
innodb_io_capacity = 10000
innodb_io_capacity_max = 20000
innodb_flush_method = O_DIRECT
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_flush_neighbors = 0
innodb_log_file_size = 200M
innodb_log_files_in_group = 2
innodb_log_buffer_size = 16M
innodb_purge_threads = 4
innodb_large_prefix = 1
innodb_thread_concurrency = 64
innodb_print_all_deadlocks = 1
innodb_strict_mode = 1
innodb_sort_buffer_size = 67108864
innodb_write_io_threads = 16
innodb_read_io_threads = 16
innodb_file_per_table = 1
innodb_stats_persistent_sample_pages = 64
innodb_autoinc_lock_mode = 2
innodb_online_alter_log_max_size = 1G
innodb_open_files = 4096
innodb_flush_log_at_trx_commit = 1
innodb_support_xa = 1
# replication settings #
master_info_repository = TABLE
relay_log_info_repository = TABLE
sync_binlog = 1
gtid_mode = on
enforce_gtid_consistency = 1
log_slave_updates
binlog_format = ROW
binlog_rows_query_log_events = 1
relay_log = relay.log
relay_log_purge = 1
relay_log_recovery = 1
report-port = 3306
report-host = 10.106.144.11
slave_skip_errors = ddl_exist_errors
slave-rows-search-algorithms = 'INDEX_SCAN,HASH_SCAN'
# semi sync replication settings #
plugin_load = "validate_password.so;rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
rpl_semi_sync_master_enabled = 1
rpl_semi_sync_master_timeout = 3000
rpl_semi_sync_slave_enabled = 1
# password plugin #
validate_password_policy=STRONG
validate-password=FORCE_PLUS_PERMANENT
# perforamnce_schema settings
performance-schema-instrument='memory/%=COUNTED'
performance_schema_digests_size = 40000
performance_schema_max_table_instances = 40000
performance_schema_max_sql_text_length = 4096
performance_schema_max_digest_length = 4096
[mysqld-5.6]
# metalock performance settings
metadata_locks_hash_instances = 64
[mysqld-5.7]
# new innodb settings #
loose_innodb_numa_interleave = 1
innodb_buffer_pool_dump_pct = 40
innodb_page_cleaners = 16
innodb_undo_log_truncate = 1
innodb_max_undo_log_size = 2G
innodb_purge_rseg_truncate_frequency = 128
# new replication settings #
slave-parallel-type = LOGICAL_CLOCK
slave-parallel-workers = 16
slave_preserve_commit_order = 1
slave_transaction_retries = 128
# other change settings #
binlog_gtid_simple_recovery = 1
show_compatibility_56 = on
# group replication settings
plugin-load = "group_replication.so;validate_password.so;semisync_master.so;semisync_slave.so"
transaction-write-set-extraction = XXHASH64
# report_host = 127.0.0.1 # optional for group replication
# binlog_checksum = NONE # only for group replication
loose_group_replication = FORCE_PLUS_PERMANENT
loose_group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
loose_group_replication_compression_threshold = 100
loose_group_replication_flow_control_mode = 0
loose_group_replication_single_primary_mode = 0
loose_group_replication_enforce_update_everywhere_checks = 1
loose_group_replication_transaction_size_limit = 10485760
loose_group_replication_unreachable_majority_timeout = 120
loose_group_replication_start_on_boot = 0
I assume the MySQL Server as followings. You should tune the variables according to your server.
- 32 CPU core
- 256G Memory
- SSD storage with 20000 IOPS in 16K page size
- MySQL最优配置模板( 5.6&5.7转)
[client] user = root --用户 password = 1111aaA_ -- 密码 [mysql] prompt = [\\u@\\p][\\d]>\\_ -- cmd控制台 ...
- Linux、docker、kubernetes、MySql、Shell、kafka、RabbitMQ运维快餐
检查端口占用 lsof -i:[port] netstat -anp |grep [port] 监控网络客户TCP连接数 netstat -anp | grep tcp |wc -l 获取某进程中运行 ...
- 【运维工程师必知必会】——MySql基础
一.SQL语句 1.分类 DDL(data definition language)数据定义语言(create.alter.drop),管理基础数据.例如:库.表 #运维要熟练,开发也要熟练 ...
- 转 移动云基于MySQL Galera的PXC运维实战
##sample 1 : mysql 监控 1.phpadmin 比较简单,适合上手 2.mysql_web python 写的, https://github.com/ycg/mysql_web/ ...
- 运维必会之MySQL篇
第一章 SQL语句 语言分类 1)DDL(data definition language)数据定义语言(create.alter.drop)管理基础数据例如:库.表 #<==运维要熟练, ...
- Linux运维入门到高级全套常用要点
Linux运维入门到高级全套常用要点 目 录 1. Linux 入门篇................................................................. ...
- 详解linux运维工程师入门级必备技能
详解linux运维工程师入门级必备技能 | 浏览:659 | 更新:2013-12-24 23:23 | 标签:linux it自动化运维就是要很方便的运用各种工具进行管理维护,有效的实施服务器保护 ...
- linux运维基础__争取十月前研究的差不多
转来的一编,考虑在十月前研究的差不多 linux运维人员基础 1.很多地方经常会用到的rsync工具 实施几台服务器的同步效果 我们公司就是使用这个工具完成服务器的游戏的服务端和客户端同步,有几个文章 ...
- MySQL最优配置文件模板·2016-11-28
小伙伴们大爱的MySQL最优配置文件模板更新啦.对之前的MySQL最优配置文件·20160901做了一些修正,更为名至实归.可以通过此链接进行下载.当然,更欢迎同学们提出意见和建议,共同打造一个最优M ...
随机推荐
- 基于OpenCv和swing的图片/视频展示Java实现
基于OpenCv和swing实现图片/视频的展示 图片的展示 swing展示图片,多为操作BufferedImage,这里要关注的核心是将Mat转为BufferedImage. 代码如下: publi ...
- fpm 打包工具安装调试
https://github.com/jordansissel/fpm 官方git yum install ruby-devel gcc make rpm-build rubygems gem so ...
- springMVC (优秀篇)
本文依然是复制的 Spring3 MVC结构简单,应了那句话简单就是美,而且他强大不失灵活,性能也很优秀. 官方的下载网址是:http://www.springsource.org/download ...
- hihocoder#1333 : 平衡树·Splay2 (区间操作)
题面: #1333 : 平衡树·Splay2 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho:好麻烦啊~~~~~ 小Hi:小Ho你在干嘛呢? 小Ho:我在干活啊! ...
- python学习日记(装饰器的补充)
如何返回被装饰函数的函数名及注释? 问题及实现 先看典型的装饰器: def wrapper(f):#装饰器函数,f是被装饰函数 def inner(*args,**kwargs): '''执行函数之前 ...
- SA / SAM 题目集
上一次做 SA / SAM 相关的题还要数到某场毒瘤 NOIP 模拟赛--这么久没做了都快忘光了--写点东西记录一些最近做到的水好题. LOJ2059 「TJOI / HEOI2016」字符串 题意 ...
- Nifi 老是死机
1. nifi服务器配置 CPU:4核 内存:7G 2. 改动如下: nifi.provenance.repository.rollover.time=30 secs --> 36000 s ...
- gulp与webpack的区别
gulp gulp强调的是前端开发的工作流程,我们可以通过配置一系列的task,定义task处理的事务(例如文件压缩合并.雪碧图.启动server.版本控制等),然后定义执行顺序,来让gulp执行这 ...
- HR_Hash Tables: Ransom Note
1 题目重点:whole words | case-sensitive #!/bin/python3 import math import os import random import re imp ...
- [JSOI2008]Blue Mary的职员分配
由于Blue Mary呕心沥血的管理,Blue Mary的网络公司蒸蒸日上.现在一共拥有了n名职员,可惜没有任何的金钱和声誉.平均每名每天职员都可以给公司带来x单位金钱或者y单位声誉(名利不能双全). ...