mariadb 10.1.9配置文件


###NOTICE:The directory about InnoDB need to create.

##################################
#######mysql client seting########
##################################

[client]
port  =  33107
default-character-set  =  utf8
socket  =  /data/mysql/mysql.sock
user  =  root
password  =  'pass_T!*80o'

##################################
#######mysql  seting##############
##################################

[mysql]
default-character-set  =  utf8
socket  =  /data/mysql/mysql.sock
no-auto-rehash 

##################################
#######mysqld seting##############
##################################

#The initial loading of the script
[mysqld]
###system
#bind-address  =  127.0.0.1
lower_case_table_names  =  1 
#skip-grant-tables 
port  =  33107
socket  =  /data/mysql/mysql.sock
pid-file  =  /data/mysql/db02.gj.com.pid
basedir  =  /data/mysql/
datadir  =  /data/mysql/data
tmpdir  =  /data/mysql/tmp
character-set-server  =  utf8 #set server character
default-storage-engine  =  INNODB
sql-mode  =  "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
table_open_cache  =  2000
open_files_limit   =   65535 
sort_buffer_size  =  2M
thread_cache_size  =  300  
tmp_table_size  =  256M
key_buffer_size  =  2048M
read_buffer_size  =  1M
read_rnd_buffer_size  =  16M

###query cache,set to disable
query_cache_type  =  0  #0 off,1 on
query_cache_size  =  20M
query_cache_limit  =  0M

###### name-resolve
skip-name-resolve
skip-host-cache
skip-external-locking


#set client (except root)
init_connect  =  'SET autocommit  =  0'
init_connect  =  'SET NAMES utf8'
init_connect  =  'SET character_set_client  =  utf8'
init_connect  =  'SET character_set_results  =  utf8'
init_connect  =  'SET character_set_connection  =  utf8'
skip-character-set-client-handshake

#networking 
wait_timeout  =  10
max_allowed_packet  =   64M 

max_connections  =  1200
max_connect_errors   =   6000

event_scheduler   =   ON

##################################
#######mysql log seting###########
##################################

###Set General Log:0 closed,1 open
general_log  =  0   
general_log_file   =   /data/mysql/mysql_logs/mysql.log
log-output  =  file 
log_warnings   =   2

#set back_log
back_log   =   1500 


#############################################
#####mysql replication and log bin############
#############################################
server_id  =  1010
binlog-format  =  ROW
log-output  =  file 
log-bin  =   /data/mysql/mysql_logs/binary_log/db02-bin
log-bin-index  =   /data/mysql/mysql_logs/binary_log/db02-bin.index


#tuning binlog
binlog_cache_size   =   4M
max_binlog_size   =   100M 
max_binlog_cache_size  =  512m
expire_logs_days   =   10

#crosscheck binlog/relaylog
binlog-checksum  =  CRC32
master-verify-checksum  =  1
slave-sql-verify-checksum  =  1
sync-master-info  =  1 #Enable it to ensure that no data is lost


## set replay log and open relay log auto repair(slave role server configure)
relay-log  =  /data/mysql/mysql_logs/relay-log
relay-log-index  =  /data/mysql/mysql_logs/relay-log.index
relay_log_purge  =  1
relay_log_recovery  =  1
master-info-file = /data/mysql/data/master.info
sync_master_info = 1 #recomand set to 1
relay-log-info-file = /data/mysql/data/relay-log.info



#open the binlog for database
#binlog-do-db   = ocp,wind
#binlog-ignore-db=suzhou,jinri

#do not need to rep database on slave role
#replicate-do-db   =   mysql
replicate-ignore-db   =   mysql,information_schema


##############mariadb parallel rep configure on master server##############
sync_binlog  =  1  #If you use the parallel replication and automated log recovery must be set to 1, the use of synchronous write disk way to write binary log write operations simultaneously will bypass the OS buffer
innodb_support_xa  =  1 #keep master crash safe,must set 1;Ensure synchronization binary log and InnoDB data files
binlog_commit_wait_count  =  20 #Custom
binlog_commit_wait_usec  =  50000 #Custom
slave_parallel_threads   =   8  #parallel rep configure

#############From MariaDB 10.0.2, global transaction ID is enabled automatically
#下面三項用於啟動GTID及滿足附屬的其它需求;如果是A -> B -> C架構需要啟用log-slave-updates該選項,
#允許備庫將其重放的事件也記錄到自身的二進制日志中;
log-slave-updates  =  true
report-host  =  172.16.0.177
report-port  =  33107


##################################
#####query log####################
##################################
#NOT OPEN
#log  =  /data/mysql/mysql_logs/query_log/query.log

##################################
#####error log####################
##################################
log-error   =   /data/mysql/mysql_logs/error_log/error.log

##################################
#####slow log#####################
##################################
slow_query_log  =  1
slow_query_log_file  =  /data/mysql/mysql_logs/slow_query_log/slowquery.log
long_query_time  =  3
log-output  =  file
log_queries_not_using_indexes  =  1 


##################################
#####max stetement time###########
##################################
max_statement_time = 5  #new feature



##################################
#####MyISAM Specific options######
##################################

myisam_max_sort_file_size  =  100G
myisam_sort_buffer_size  =  58M

##################################
#####INNODB Specific options######
##################################

innodb_buffer_pool_instances   =   8
innodb_data_home_dir  =  /data/mysql/innodb_data
innodb_data_file_path  =  ibdata1:200M;ibdata2:200M:autoextend
innodb_file_per_table  =  1
innodb_log_buffer_size  =  16M
innodb_buffer_pool_size  =  56000M
innodb_log_group_home_dir  =  /data/mysql/mysql_logs/innodb_log/
innodb_log_files_in_group  =  3
innodb_log_file_size  =  2G
innodb_max_dirty_pages_pct   =   90 
innodb_flush_log_at_trx_commit  =  2
innodb_thread_concurrency   =   0  #Set to 0 when using the threadpool
innodb_thread_sleep_delay   =   500
innodb_concurrency_tickets   =   5000
innodb_read_io_threads   =   16  
innodb_write_io_threads   =   4  
innodb_io_capacity   =   2000
innodb_lock_wait_timeout   =   30
innodb_purge_threads   =   1
innodb_purge_batch_size   =  300
innodb_open_files   =   2000
innodb_read_ahead_threshold   =   56
innodb_flush_method   =   O_DIRECT  
innodb_use_native_aio   =   on
innodb_use_sys_malloc   =   on
innodb_buffer_pool_dump_at_shutdown   =   1
innodb_buffer_pool_dump_now   =   1
innodb_buffer_pool_load_at_startup   =   1
innodb_buffer_pool_load_now   =   1

#thread pool and NUM
thread_handling   =   pool-of-threads 
innodb_buffer_pool_populate   =   1 

[mysqld_safe]
open-files-limit   =   28192


[mysqldump] 
quick 
max_allowed_packet  =   64M 

[mysqlhotcopy] 
interactive_timeout   =   28400 


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com