主从复制从服务器标准配置my.cnf

[client]
port            = 3306

default-character-set = utf8
# The MySQL server

[mysqld]
port            = 3306
socket          = /tmp/mysql_smart.sock
user = mysql
server-id=173

#####################Standard Configuration########################

#Hugepage
#large-pages
skip-name-resolve
external-locking = FALSE
read_only=1

pid-file = /database/smart/data/smart.pid
datadir = /database/smart/data/
#log-bin=/database/smart/binlog/smart_bin

#delete binlog before 30 day
expire_logs_days =30

max_binlog_cache_size = 256M
max_binlog_size = 1G
binlog_cache_size = 64M
relay-log-index = /database/smart/relaylog/smart-relay-bin.index
relay-log-info-file = /database/smart/relaylog/smart-relay-bin
relay-log = /database/smart/relaylog/smart-relay-log.info

innodb_log_file_size = 200M
innodb_log_files_in_group=3
innodb_log_buffer_size = 128M


#tablespace 
innodb_file_per_table = 1
# first write log buffer ,secend write log file
innodb_flush_log_at_trx_commit = 2

innodb_lock_wait_timeout =50
innodb_thread_concurrency=8
innodb_read_io_threads=30 
innodb_write_io_threads=30

#event
event_scheduler = 1

#no lower and no upper
lower_case_table_names=1

#group_concat
group_concat_max_len=1M

# binary logging format - mixed recommended
binlog_format=mixed
init_connect='SET AUTOCOMMIT=0'
connect_timeout=600
wait_timeout=120
interactive_timeout=120
ft_min_word_len=1

default-storage-engine=INNODB
max_connections = 10000
max_connect_errors = 50000
max_user_connections=5000

max_allowed_packet=1024M

init-connect="SET NAMES utf8"
character-set-server =utf8


# apply to application
auto_increment_offset=1
auto_increment_increment=2

#slow_log
#must be restart
#log_slow_queries=1
log_output=table
long_query_time = 5
slow_query_log=1
#general_log_file=on
#log-queries-not-using-indexes

#####################Others Configuration########################

net_buffer_length = 8K
read_rnd_buffer_size = 8M

# cache
back_log = 512
key_buffer_size =256M
thread_stack = 256K
table_cache = 1024
sort_buffer_size = 128M
read_buffer_size = 4M
join_buffer_size = 8M
#record_buffer = 32M


myisam_sort_buffer_size = 128M
thread_cache = 32
thread_cache_size = 128
query_cache_size =256M
query_cache_type = 1
tmp_table_size = 20M
max_heap_table_size = 64M
thread_concurrency = 8
innodb_buffer_pool_size=2000M

binlog-do-db=smart
binlog-do-db=firstdb 
binlog-ignore-db=mysql 
replicate-do-db=firstdb
replicate-do-db=smart 
replicate-ignore-db=mysql 
replicate-do-db=test
binlog-do-db=test


log-slave-updates
slave-skip-errors=all

[mysqldump]
quick
max_allowed_packet = 512M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值