lYong90

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

 

[client]
user = root
password = Yong_110
 
[mysql]
prompt = [\\u@\\p][\\d]>\\_
no-auto-rehash
 
[mysqld_safe]
##默认的内存分配就是c的malloc,建议使用tcmalloc或者jemalloc,优化内存分配
malloc-lib=/usr/lib64/libjemalloc.so
 
[mysqldump]
##证在备份过程中整个备份集的数据一致性
single-transaction
 
[mysqld]
# basic settings
user = mysql
server-id = 7306
port = 7306
sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
autocommit = 1
##指定字符集
character_set_server=utf8mb4
##指定MySQLserver常用路径
basedir =/usr/local/mysql
datadir=/ydata/my57/7306/data
tmpdir = /ydata/my57/7306/data/tmp
socket  = /ydata/my57/7306/run/mysql.sock
pid-file=/ydata/my57/7306/run/mysql.pid
##指定事物隔离级别,默认REPEATABLE-READ
transaction_isolation = READ-COMMITTED
##设置为on表示timestamp列的值都要显示指定
explicit_defaults_for_timestamp = 1
##最大为1G,默认1M(<=5.6.5)或者4M(>=5.6.6),建议调整,避免Packet too large 或者MySQL gone away错误发生
max_allowed_packet = 64M
event_scheduler = 1
skip-name-resolve
# metalock performance settings
metadata_locks_hash_instances = 64
# password plugin
validate_password_policy = STRONG
validate-password = FORCE_PLUS_PERMANENT
 
 
# connection settings
##服务器关闭交互式连接前等待活动的秒数,默认28800秒(8小时)
interactive_timeout = 1800
##服务器关闭非交互连接之前等待活动的秒数,默认28800秒(8小时)
wait_timeout = 1800
##锁等待的时间,默认50s
lock_wait_timeout = 1800
skip_name_resolve = 1
##External-locking用于多进程条件下为MyISAM数据表进行锁定
skip-external-locking
max_connections = 1024
max_user_connections = 256
max_connect_errors = 1000000
 
# table cache 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
 
# binlog settings
sync_binlog = 1
binlog_format = ROW
binlog_rows_query_log_events = 1
log_bin=/ydata/my57/7306/dblogs/binlog/binlog
gtid_mode = on
enforce_gtid_consistency = 1
sync_master_info = 1
 
#replication settings
master_info_repository = TABLE
relay_log_info_repository = TABLE
log_slave_updates
relay_log = /ydata/my57/7306/dblogs/relaylog/relay.log
max-relay-log-size=512M
relay_log_recovery = 1
slave_skip_errors = ddl_exist_errors
slave_rows_search_algorithms = 'INDEX_SCAN,HASH_SCAN'
sync_relay_log = 1
sync_relay_log_info = 1
 
# semi sync replication settings
plugin-load = "group_replication.so;validate_password.so;semisync_master.so;semisync_slave.so"
loose_rpl_semi_sync_master_enabled = 1
loose_rpl_semi_sync_master_timeout = 3000
loose_rpl_semi_sync_slave_enabled = 1
 
 
# log settings #
log_error = /ydata/my57/7306/logs/alter.log
log_error_verbosity = 2
general_log=0
general_log_file = /ydata/my57/7306/logs/general.log
slow_query_log = 1
long_query_time = 2
slow_query_log_file = /ydata/my57/7306/logs/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 = 90
min_examined_row_limit = 100
log-bin-trust-function-creators = 1
log-slave-updates = 1
 
###innodb  base settings
innodb_page_size = 16384
innodb_data_home_dir =/ydata/my57/7306/data
innodb_lock_wait_timeout = 5
innodb_stats_persistent_sample_pages = 64
innodb_autoinc_lock_mode = 2
innodb_large_prefix = 1
innodb_thread_concurrency = 64
innodb_print_all_deadlocks = 1
innodb_strict_mode = 1
 
##innodb  memory
innodb_buffer_pool_size = 160G
innodb_sort_buffer_size = 64M
innodb_buffer_pool_instances = 16
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_online_alter_log_max_size=1G
 
##innodb io setting 
innodb_write_io_threads = 16
innodb_read_io_threads = 16 
innodb_purge_threads = 4
innodb_file_per_table = 1
innodb_open_files=4096
innodb_io_capacity = 10000
innodb_io_capacity_max = 20000
innodb_flush_method = O_DIRECT
innodb_lru_scan_depth = 4096
innodb_flush_neighbors = 0
 
# innodb redo/undo settings #
innodb_log_buffer_size = 64M
innodb_log_group_home_dir = /ydata/my57/7306/dblogs/redolog
innodb_data_file_path = ibdata1:100M:autoextend
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
 
# 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

 

posted on 2018-08-08 10:47  lYong90  阅读(255)  评论(0)    收藏  举报