[mysqld] #-------------------------------------basic_my.conf------------------------------------------------------------- #5.7 #author: duxing #modify: 20160902 #version: 0.8 #------------------basic-------------------------------# user=mysql basedir = /u01/app/mysql/db datadir = /data/mysql/data pid-file = /data/mysql/mysql.pid socket=/data/mysql/mysql.sock default-storage-engine = INNODB transaction_isolation = REPEATABLE-READ binlog_cache_size = 32M max_binlog_size=512M binlog_format=row character-set-server = utf8 port=3306 server-id= 2 #sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY' explicit_defaults_for_timestamp = true log-error = /data/mysql/mysql-error.log slow_query_log long_query_time = 10 log_warnings #------------------basic-------------------------------# #---------------directroy------------------------------# innodb_log_group_home_dir=/data/mysql/engine/innolog innodb_data_home_dir=/data/mysql/engine/innodata innodb_data_file_path = ibdata1:500M;ibdata2:150M:autoextend innodb_undo_directory=/data/mysql/engine/undo log-bin = /data/mysql/log/mysql-binlog/mysql-binlog log-bin-index = /data/mysql/log/mysql-binlog/mysql-binlog.index expire-logs-days=5 relay_log = /data/mysql/log/mysql-relaylog/mysql-relay-bin relay_log_index= /data/mysql/log/mysql-relaylog/mysql-relay-bin.index #relay_log_info_file=/data/mysql/log/mysql-relaylog/relay-log.info #---------------directroy------------------------------# #----------------engine--------------------------------# innodb_file_per_table=1 innodb_api_enable_binlog=1 innodb_buffer_pool_size=256M innodb_flush_log_at_trx_commit = 1 innodb_log_buffer_size = 16M innodb_log_file_size = 512M innodb_log_files_in_group = 4 innodb_max_dirty_pages_pct = 75 innodb_lock_wait_timeout = 120 innodb_buffer_pool_instances=2 innodb_force_recovery=0 #recover innodb_purge_threads=4 #undo purge innodb_write_io_threads = 16 innodb_read_io_threads = 16 innodb_io_capacity=1200 innodb_old_blocks_pct=37 innodb_old_blocks_time=1000 innodb_undo_tablespaces=12 innodb_undo_logs=40 innodb_commit_concurrency = 1000 #commit/s innodb_thread_concurrency = 1000 #use for cpu mutex innodb_thread_sleep_delay = 200 #ms delay time #innodb_use_native_aio=1 #----------------engine--------------------------------# # ------------global cache -------------------------# read_buffer_size = 32M read_rnd_buffer_size = 128M sort_buffer_size = 64M join_buffer_size = 64M query_cache_size = 128M query_cache_limit = 4M tmp_table_size = 128M # ------------global cache -------------------------# #----------------replicat-----------------------------# #read_only=1 relay_log_purge=0 log_slave_updates=1 slave_parallel_workers=4 log_bin_trust_function_creators=1 binlog_checksum = CRC32 slave_allow_batching = 1 master_verify_checksum = 1 slave_sql_verify_checksum = 1 binlog_rows_query_log_events = 1 gtid-mode=on enforce-gtid-consistency=1 sync-master-info=1 relay_log_purge = 1 #relaylog的自动修复 relay_log_recovery = 1 master_info_repository = TABLE relay_log_info_repository = TABLE #set global rpl_semi_sync_master_enabled = 1 #set global rpl_semi_sync_slave_enabled =1 #rpl_semi_sync_master_timeout=200 #----------------replicat-----------------------------# #-----------------thread------------------------------# table_open_cache = 2048 #reduce open descriptor thread_stack = 256K # *thead_num < useable mem thread_cache_size = 128 #reuse thread in mem #-----------------thread------------------------------# #----------------network-----------------------------# back_log = 512 #skip-networking #skip-grant-tables skip-name-resolve max_connections = 3000 max_connect_errors = 30 table_open_cache = 4096 max_allowed_packet = 64M max_heap_table_size = 512M #----------------network-----------------------------# #-----------------------timeout------------------------# connect-timeout = 10 wait-timeout = 8000 interactive-timeout = 8000 slave-net-timeout = 60 net_read_timeout = 30 net_write_timeout = 60 net_retry_count = 10 net_buffer_length = 16384 #-----------------------timeout------------------------# [mysql] auto-rehash [client] socket=/data/mysql/mysql.sock port=3306 |